Commit a118e48c authored by Christoph Grüninger's avatar Christoph Grüninger

[CMake] Use dune_add_test, fix broken configuration

Still force that all tests are built for target all.
parent d95e59d0
......@@ -20,89 +20,46 @@ include(DuneMacros)
# start a dune project with information from dune.module
dune_project()
set(GRIDTYPE YASPGRID)
set(GRIDDIM 2)
# The directory where the example grid files used for the examples are located
set_property(DIRECTORY APPEND PROPERTY
COMPILE_DEFINITIONS "DUNE_GRID_HOWTO_EXAMPLE_GRIDS_PATH=\"${PROJECT_SOURCE_DIR}/grids/\"")
# force that all tests are built
set(DUNE_BUILD_TESTS_ON_MAKE_ALL TRUE)
set(TESTS
adaptivefinitevolume
adaptiveintegration
finiteelements
finitevolume
gettingstarted
integration
othergrids
parfinitevolume
traversal
visualization)
# enable the flags for all third party features found
dune_enable_all_packages()
add_executable(adaptivefinitevolume adaptivefinitevolume.cc)
add_dune_all_flags(adaptivefinitevolume)
dune_add_test(SOURCES adaptivefinitevolume.cc
COMPILE_DEFINITIONS "GRIDDIM=2" "WORLDDIM=2" "YASPGRID")
add_dune_alberta_flags(adaptivefinitevolume WORLDDIM 2)
add_dune_mpi_flags(adaptivefinitevolume)
add_executable(adaptiveintegration adaptiveintegration.cc)
add_dune_all_flags(adaptiveintegration)
add_dune_mpi_flags(adaptiveintegration)
dune_add_test(SOURCES adaptiveintegration.cc
COMPILE_DEFINITIONS "GRIDDIM=2" "WORLDDIM=2" "YASPGRID")
add_executable(finiteelements finiteelements.cc)
add_dune_all_flags(finiteelements)
add_dune_mpi_flags(finiteelements)
dune_add_test(SOURCES finiteelements.cc)
add_executable(finitevolume finitevolume.cc)
add_dune_all_flags(finitevolume)
add_dune_mpi_flags(finitevolume)
dune_add_test(SOURCES finitevolume.cc
COMPILE_DEFINITIONS "GRIDDIM=2" "WORLDDIM=2" "YASPGRID")
add_executable(integration integration.cc)
add_dune_all_flags(integration)
add_dune_mpi_flags(integration)
dune_add_test(SOURCES integration.cc
COMPILE_DEFINITIONS "GRIDDIM=2" "WORLDDIM=2" "YASPGRID")
add_executable(gettingstarted gettingstarted.cc)
add_dune_all_flags(gettingstarted)
add_dune_mpi_flags(gettingstarted)
dune_add_test(SOURCES gettingstarted.cc)
add_executable(othergrids othergrids.cc)
add_dune_all_flags(othergrids)
add_dune_mpi_flags(othergrids)
dune_add_test(SOURCES othergrids.cc)
add_executable(parfinitevolume parfinitevolume.cc)
add_dune_all_flags(parfinitevolume)
add_dune_mpi_flags(parfinitevolume)
dune_add_test(SOURCES parfinitevolume.cc)
add_executable(traversal traversal.cc)
add_dune_all_flags(traversal)
add_dune_mpi_flags(traversal)
dune_add_test(SOURCES traversal.cc)
add_executable(visualization visualization.cc)
add_dune_all_flags(visualization)
add_dune_mpi_flags(visualization)
dune_add_test(SOURCES visualization.cc
COMPILE_DEFINITIONS "GRIDDIM=2" "WORLDDIM=2" "YASPGRID")
add_subdirectory(doc)
add_subdirectory(grids)
set_property(TARGET
adaptivefinitevolume
adaptiveintegration
finitevolume
integration
visualization APPEND
PROPERTY COMPILE_DEFINITIONS "GRIDDIM=${GRIDDIM}" "WORLDDIM=${GRIDDIM}" "${GRIDTYPE}")
# We do not want want to build the tests during make all,
# but just build them on demand
SET(_test_target dune_grid_howto_tests)
add_custom_target(${_test_target})
dune_common_script_dir(SCRIPT_DIR)
configure_file(${SCRIPT_DIR}/BuildTests.cmake.in BuildTests.cmake @ONLY)
add_dependencies(${_test_target} ${TESTS})
foreach(_test ${TESTS})
add_test(${_test} ${_test})
endforeach(_test ${TESTS})
# install headers, cc files and executables
install(FILES
basicunitcube.hh
elementdata.hh
......
Markdown is supported
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