Skip to content
Snippets Groups Projects
Commit c32d5e70 authored by Timo Koch's avatar Timo Koch
Browse files

[cmake] Fix broken input file links

It was checked in add_dumux_test whether the to be linked input file exists
but then another file was linked in some occations. 
Use the path relative to the source directory to fix the broken links.


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@15326 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent e3c1f471
No related branches found
No related tags found
No related merge requests found
...@@ -13,20 +13,22 @@ ...@@ -13,20 +13,22 @@
# - further arguments: are optional and are used as arguments for calling the test # - further arguments: are optional and are used as arguments for calling the test
### ###
macro(add_dumux_test dumux_test dumux_test_executable dumux_test_executable_source) macro(add_dumux_test dumux_test dumux_test_executable dumux_test_executable_source)
# if present, copy grids folder # if present, symlink the grids folder
set(grids_directory ${CMAKE_CURRENT_SOURCE_DIR}/grids) set(grids_directory ${CMAKE_CURRENT_SOURCE_DIR}/grids)
if(EXISTS ${grids_directory} AND IS_DIRECTORY ${grids_directory}) if(EXISTS ${grids_directory} AND IS_DIRECTORY ${grids_directory})
dune_symlink_to_source_files(FILES grids) dune_symlink_to_source_files(FILES grids)
endif() endif()
# if present, copy input file # if present, symlink the input file
set(input_file ${CMAKE_CURRENT_SOURCE_DIR}/${dumux_test_executable}.input) set(input_file ${CMAKE_CURRENT_SOURCE_DIR}/${dumux_test_executable}.input)
if(NOT EXISTS ${input_file}) if(NOT EXISTS ${input_file})
get_filename_component(base_source_name ${dumux_test_executable_source} NAME_WE) get_filename_component(base_source_name ${dumux_test_executable_source} NAME_WE)
set(input_file ${CMAKE_CURRENT_SOURCE_DIR}/${base_source_name}.input) set(input_file ${CMAKE_CURRENT_SOURCE_DIR}/${base_source_name}.input)
endif() endif()
if(EXISTS ${input_file}) if(EXISTS ${input_file})
dune_symlink_to_source_files(FILES "${dumux_test_executable}.input") # dune symlink takes a path relative to the source directory
get_filename_component(input_file ${input_file} NAME_WE)
dune_symlink_to_source_files(FILES ${input_file}.input)
endif() endif()
# add executable # add executable
......
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