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

[CMake] Do copies as a fall-back if symlinks are not available on the platform

There is still a warning issued in that case.
parent b6987367
Branches
Tags
No related merge requests found
......@@ -1228,16 +1228,18 @@ endmacro(dune_symlink_to_source_tree)
# 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})
# create symlinks for all given files
foreach(f ${files})
# check for Windows 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()
dune_add_copy_command(${f})
else()
# create symlink
execute_process(COMMAND ${CMAKE_COMMAND} "-E" "create_symlink" "${CMAKE_CURRENT_SOURCE_DIR}/${f}" "${CMAKE_CURRENT_BINARY_DIR}/${f}")
endforeach()
endif()
endif()
endforeach()
endmacro(dune_symlink_to_source_files files)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment