Clean up CTest usage.
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 14 Sep 2013 18:48:35 +0000 (21:48 +0300)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 4 Oct 2013 09:06:39 +0000 (11:06 +0200)
- Remove use of backwards-compatibility Dart include; we are not using
  such dashboards.
- Move CTest include to the top of the main CMakeLists.txt.  This clears
  a lot of confusion about how BUILD_TESTING works, as it is declared by
  CTest.  Previously it worked because include(Dart) also declared it.
- The memory check suppression file needs a different treatment.  That
  also seems to have worked only because CTest was included twice.

Change-Id: I418997bfe01a0f3d90f40558a4dbba10f4744af7

CMakeLists.txt

index ffd266501527cef01c31912287daceddedac33b5..5dcfe985fe4b38092954004084cb9755cad51655 100644 (file)
@@ -7,8 +7,6 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform)
 
 project(Gromacs)
-include(Dart)
-mark_as_advanced(DART_ROOT)
 
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@@ -87,6 +85,15 @@ set(CPACK_PACKAGE_CONTACT "gmx-users@gromacs.org")
 #must come after all cpack settings!
 include(CPack)
 
+# Set a default valgrind suppression file.
+# This unfortunately needs to duplicate information from CTest to work as
+# expected...
+set(MEMORYCHECK_SUPPRESSIONS_FILE
+    "${CMAKE_SOURCE_DIR}/cmake/legacy_and_external.supp"
+    CACHE FILEPATH
+    "File that contains suppressions for the memory checker")
+include(CTest)
+
 set(SOURCE_IS_GIT_REPOSITORY OFF)
 set(SOURCE_IS_SOURCE_DISTRIBUTION OFF)
 if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
@@ -604,7 +611,6 @@ if (GMX_BUILD_UNITTESTS AND NOT LIBXML2_FOUND)
         "Cannot build unit tests without libxml2. "
         "Either set GMX_BUILD_UNITTESTS=OFF or tell CMake how to find libxml2.")
 endif()
-set(MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/cmake/legacy_and_external.supp)
 
 ########################################################################
 # Generate development version info for cache
@@ -1261,8 +1267,6 @@ ADD_CUSTOM_TARGET(uninstall
 # Tests                                                                #
 ########################################################################
 
-include(CTest)
-mark_as_advanced(BUILD_TESTING)
 IF(BUILD_TESTING)
     enable_testing()
     #"check" target builds and runs all tests
@@ -1277,4 +1281,3 @@ IF(BUILD_TESTING)
     endif()
     #TODO: Add warning if NOT REGRESSIONTEST_PATH OR NOT GMX_XML that regression/unit tests are not run.
 ENDIF()
-