Skip to content
Snippets Groups Projects
Commit 3734f8d2 authored by Steffen Müthing's avatar Steffen Müthing
Browse files

Merge branch 'master' into feature/FS1557-add-all-flags-by-default

* master:
  Allow enabling dune_symlink_to_source_tree from the opts file
  Fix dune_symlink_to_source_tree for cmake 3.1
parents 2c3c90f3 0154ec05
No related branches found
No related tags found
No related merge requests found
...@@ -669,6 +669,10 @@ macro(dune_project) ...@@ -669,6 +669,10 @@ macro(dune_project)
exec_program(chmod ARGS "+x ${CMAKE_BINARY_DIR}/compiler.sh") exec_program(chmod ARGS "+x ${CMAKE_BINARY_DIR}/compiler.sh")
set(CMAKE_CXX_COMPILER ${CMAKE_BINARY_DIR}/compiler.sh) set(CMAKE_CXX_COMPILER ${CMAKE_BINARY_DIR}/compiler.sh)
endif() endif()
if(DUNE_SYMLINK_TO_SOURCE_TREE)
dune_symlink_to_source_tree()
endif()
endmacro(dune_project) endmacro(dune_project)
# create a new config.h file and overwrite the existing one # create a new config.h file and overwrite the existing one
......
...@@ -72,12 +72,14 @@ macro(dune_symlink_to_source_tree) ...@@ -72,12 +72,14 @@ macro(dune_symlink_to_source_tree)
endif() endif()
else() else()
# get a list of all files in the current source directory and below. # get a list of all files in the current source directory and below.
file(GLOB_RECURSE files RELATIVE ${CMAKE_SOURCE_DIR} "*") file(GLOB_RECURSE files RELATIVE ${CMAKE_SOURCE_DIR} ".*CMakeLists.txt")
# iterate over all files, extract the directory name and write a symlink in the corresponding build directory # iterate over all files, extract the directory name and write a symlink in the corresponding build directory
foreach(f ${files}) foreach(f ${files} "./")
get_filename_component(dir ${f} DIRECTORY) get_filename_component(dir ${f} DIRECTORY)
execute_process(COMMAND ${CMAKE_COMMAND} "-E" "create_symlink" "${CMAKE_SOURCE_DIR}/${dir}" "${CMAKE_BINARY_DIR}/${dir}/src_dir") if(NOT dir MATCHES "${CMAKE_BINARY_DIR}/*")
execute_process(COMMAND ${CMAKE_COMMAND} "-E" "create_symlink" "${CMAKE_SOURCE_DIR}/${dir}" "${CMAKE_BINARY_DIR}/${dir}/src_dir")
endif(NOT dir MATCHES "${CMAKE_BINARY_DIR}/*")
endforeach() endforeach()
endif() endif()
endmacro(dune_symlink_to_source_tree) endmacro(dune_symlink_to_source_tree)
......
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