Commit 4f7316eb authored by Christoph Grueninger's avatar Christoph Grueninger
Browse files

[CMake] Add function add_dumux_all_flags.

The function can be used instead of calling the
add_dune_*_flag functions.
The function is called from add_dumux_test.
(reviewed by bernd)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@13785 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 077015a6
...@@ -48,8 +48,8 @@ macro(add_dumux_test dumux_test dumux_test_executable dumux_test_executable_sour ...@@ -48,8 +48,8 @@ macro(add_dumux_test dumux_test dumux_test_executable dumux_test_executable_sour
endif(${DUMUX_BUILD_ALL_TESTS}) endif(${DUMUX_BUILD_ALL_TESTS})
endif(NOT TARGET ${dumux_test_executable}) endif(NOT TARGET ${dumux_test_executable})
# link all libraries to executable # link all libraries to executable, add all flags
target_link_libraries(${dumux_test_executable} ${DUNE_LIBS}) add_dumux_all_flags(${dumux_test_executable})
# get optional arguments # get optional arguments
# cannot use ARGN directly with list() command, copy to a variable first # cannot use ARGN directly with list() command, copy to a variable first
...@@ -59,4 +59,23 @@ macro(add_dumux_test dumux_test dumux_test_executable dumux_test_executable_sour ...@@ -59,4 +59,23 @@ macro(add_dumux_test dumux_test dumux_test_executable dumux_test_executable_sour
# add test # add test
add_test(${dumux_test} ${dumux_test_args}) add_test(${dumux_test} ${dumux_test_args})
add_dependencies(${_test_target} ${dumux_test_executable}) add_dependencies(${_test_target} ${dumux_test_executable})
endmacro(add_dumux_test) endmacro()
###
# adds flags for all third party libraries used in DuMuX to the given targets
###
function(add_dumux_all_flags)
cmake_parse_arguments(ADD_DUMUX_ALL_FLAGS "" "" "" ${ARGN})
foreach(_target ${ADD_DUMUX_ALL_FLAGS_UNPARSED_ARGUMENTS})
# add flags
add_dune_mpi_flags(${_target})
add_dune_alberta_flags(${_target})
add_dune_alugrid_flags(${_target})
add_dune_ug_flags(${_target})
add_dune_umfpack_flags(${_target})
add_dune_superlu_flags(${_target})
# add Dune libraries
target_link_libraries(${_target} ${DUNE_LIBS})
target_link_libraries(${_target} ${ZLIB_LIBRARIES})
endforeach()
endfunction()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment