From: maier Date: Sat, 17 Aug 2013 02:44:13 +0000 (+0000) Subject: CMake: Prepare build system for porting the test suite to CMake X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d618281d9742716d1e125bf1b07f539ef929d83d;p=dealii-svn.git CMake: Prepare build system for porting the test suite to CMake git-svn-id: https://svn.dealii.org/trunk@30329 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 45d1ad2964..714613a8c7 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -49,7 +49,7 @@ FOREACH(_file ${_macro_files}) ENDFOREACH() # -# Check whether the doc and bundled folders are available: +# Check for the existence of various optional folders: # IF(EXISTS ${CMAKE_SOURCE_DIR}/bundled/CMakeLists.txt) SET(DEAL_II_HAVE_BUNDLED_DIRECTORY TRUE) @@ -59,6 +59,14 @@ IF(EXISTS ${CMAKE_SOURCE_DIR}/doc/CMakeLists.txt) SET(DEAL_II_HAVE_DOC_DIRECTORY TRUE) ENDIF() +IF(NOT DEFINED TEST_DIR) + GET_FILENAME_COMPONENT(TEST_DIR "${CMAKE_SOURCE_DIR}" PATH) + SET(TEST_DIR "${TEST_DIR}/tests") +ENDIF() +IF(EXISTS ${TEST_DIR}/CMakeLists.txt) + SET(DEAL_II_HAVE_TESTS_DIRECTORY TRUE) +ENDIF() + # # We have to initialize some cached variables before PROJECT is called, so # do it at this point: @@ -137,6 +145,10 @@ ADD_SUBDIRECTORY(cmake/config) # has to be included after source ADD_SUBDIRECTORY(contrib) # has to be included after source ADD_SUBDIRECTORY(examples) +IF(DEAL_II_HAVE_TESTS_DIRECTORY) + ADD_SUBDIRECTORY(${TEST_DIR} ${CMAKE_BINARY_DIR}/tests) +ENDIF() + # # And finally, print the configuration: # diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000000..dcca0f909d --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1 @@ +ADD_CUSTOM_TARGET(foobar)