Skip to content
Snippets Groups Projects
Commit 1ca7dbfd authored by Dominic Kempf's avatar Dominic Kempf
Browse files

[CMake] add macro dune_symlink_to_source_files

add symlinks to the build tree, which point to files in the source tree.
Foreach file given in "files", a symlink of that name is created in the
corresponding build directory. Use for ini files, grid files etc. A warning
is issued on Windows systems.
parent 61841f1f
No related branches found
No related tags found
No related merge requests found
......@@ -1186,3 +1186,22 @@ macro(dune_symlink_to_source_tree)
endforeach()
endif()
endmacro(dune_symlink_to_source_tree)
# add symlinks to the build tree, which point to files in the source tree.
# Foreach file given in "files", a symlink of that name is created in the
# corresponding build directory. Use for ini files, grid files etc. A warning
# is issued on Windows systems.
macro(dune_symlink_to_source_files files)
# check for Windwos to issue a warning
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
if(NOT DEFINED DUNE_WINDOWS_SYMLINK_WARNING)
message(WARNING "Your module wanted to create symlinks, but you cannot do that on your platform.")
set(DUNE_WINDOWS_SYMLINK_WARNING)
endif()
else()
# create symlinks for all given files
foreach(f ${files})
execute_process(COMMAND ${CMAKE_COMMAND} "-E" "create_symlink" "${CMAKE_CURRENT_SOURCE_DIR}/${f}" "${CMAKE_CURRENT_BINARY_DIR}/${f}")
endforeach()
endif()
endmacro(dune_symlink_to_source_files files)
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