Skip to content
Snippets Groups Projects
Commit 4efd9cfd authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

cmake: create symlink instead of copies

parent 913f8453
No related branches found
No related tags found
1 merge request!50Refactor CMake scripts
......@@ -23,16 +23,8 @@ mtime_add_example(example example.f90)
add_library(event_manager OBJECT mo_event_manager.f90)
target_link_libraries(event_manager PRIVATE mtime::mtime)
file(
COPY "${CMAKE_CURRENT_SOURCE_DIR}/iconatm.nml"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}"
)
mtime_add_example(iconatm iconatm.f90 DEPENDS $<TARGET_OBJECTS:event_manager>)
file(
COPY "${CMAKE_CURRENT_SOURCE_DIR}/iconoce.nml"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}"
)
mtime_add_example(iconoce iconoce.f90 DEPENDS $<TARGET_OBJECTS:event_manager>)
mtime_add_example(model_integration model_integration.c)
......@@ -64,3 +56,14 @@ if(MT_ENABLE_FORTRAN_HL)
mtime_add_example(simulate_iau simulate_iau.f90)
endif()
foreach(namelist IN ITEMS iconatm.nml iconoce.nml)
file(
CREATE_LINK
${CMAKE_CURRENT_SOURCE_DIR}/${namelist}
${CMAKE_CURRENT_BINARY_DIR}/${namelist}
RESULT
dummy # just don't fail if something goes wrong (e.g. building in-source)
COPY_ON_ERROR SYMBOLIC
)
endforeach()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment