]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Proper fix, some final rearrangement.
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 4 Oct 2013 20:30:03 +0000 (20:30 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 4 Oct 2013 20:30:03 +0000 (20:30 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31126 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/config/CMakeLists.txt
deal.II/cmake/setup_custom_targets.cmake
tests/CMakeLists.txt

index 7c8b5c3a30b4672652d9a686a1525c9bf5925640..b2989230251c5bc867613477f907c05cf01125e0 100644 (file)
@@ -22,7 +22,7 @@
 #   deal.IIVersionConfig.cmake
 #
 # and copies it (a) to the build directory and (b) prepares it for later
-# installation (the copy in CMAKE_CURRENT_BINARY_DIR).
+# installation.
 #
 
 #
@@ -308,22 +308,23 @@ ENDIF()
 
 #
 # Finally, add a target to create the "binary" file in
-# ${DEAL_II_PROJECT_CONFIG_RELDIR} and add it to the library target:
+# ${DEAL_II_PROJECT_CONFIG_RELDIR} and add it to the "all" target:
 #
 ADD_CUSTOM_TARGET(setup_build_dir ALL
   COMMAND ${CMAKE_COMMAND} -E touch
     ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/binary
   COMMAND ${CMAKE_COMMAND} -E touch
     ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
-  COMMENT "Update build configuration"
+  COMMENT "Update build directory"
   )
-ADD_DEPENDENCIES(library setup_build_dir)
 FOREACH(_build ${DEAL_II_BUILD_TYPES})
   ADD_DEPENDENCIES(setup_build_dir ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX})
 ENDFOREACH()
 
 #
 # And a script to remove it upon installation from the install prefix:
+# This is necessary if somebody wants to install into the build directory
+# (yes this is a valid use case...).
 #
 INSTALL(CODE
   "
index 2f42194a01283c6cdcb608e011f3ad218e15ee09..5b73f3e30c527314e01aa431f3656eed536f2321 100644 (file)
 # Add convenience targets that build and install only a specific component:
 #
 
-FOREACH(_component library)
-  ADD_CUSTOM_TARGET(${_component}
-    # COMMAND ${CMAKE_COMMAND}
-    #   -DCOMPONENT="${_component}" -P cmake_install.cmake
-    # COMMENT "Build and install component \"${_component}\"."
-    # WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-    )
-ENDFOREACH()
+# The library can always be installed ;-)
+ADD_CUSTOM_TARGET(library
+  COMMAND ${CMAKE_COMMAND}
+    -DCOMPONENT="library" -P cmake_install.cmake
+  COMMENT "Build and install component \"library\"."
+  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+  )
 
 FOREACH(_component compat_files documentation examples mesh_converter parameter_gui)
   STRING(TOUPPER "${_component}" _component_uppercase)
   IF(DEAL_II_COMPONENT_${_component_uppercase})
-
     ADD_CUSTOM_TARGET(${_component}
       COMMAND ${CMAKE_COMMAND}
         -DCOMPONENT="${_component}" -P cmake_install.cmake
       COMMENT "Build and install component \"${_component}\"."
       WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
       )
-
   ELSE()
-
     ADD_CUSTOM_TARGET(${_component}
       COMMAND ${CMAKE_COMMAND} -E echo "Error: Could not build and install disabled component \"${_component}\"."
         && ${CMAKE_COMMAND} -E echo "Please reconfigure with -DDEAL_II_COMPONENT_${_component}=yes"
         && false
       )
-
   ENDIF()
 ENDFOREACH()
-
index f62f2843a086f9dd0ba14c9beea95c40c321a8b1..1de72dd17ef6831ded402dd254c12002a4de285d 100644 (file)
@@ -33,19 +33,32 @@ IF(NOT "${CMAKE_PROJECT_NAME}" STREQUAL "deal.II")
     )
 ENDIF()
 
-SET(_options)
-
+#
 # Write a minimalistic CTestTestfile.cmake file to CMAKE_BINARY_DIR:
+#
 FILE(WRITE ${CMAKE_BINARY_DIR}/CTestTestfile.cmake
   "SUBDIRS(tests)"
   )
 
-LIST(APPEND _options -DDEAL_II_SOURCE_DIR=${CMAKE_SOURCE_DIR})
-LIST(APPEND _options -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR})
+#
+# The hook into CTest so that the tests from the suprojects get picked up
+# by the main project:
+#
+
+FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/deal.IITestfile.cmake "")
+SET_PROPERTY(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  APPEND PROPERTY TEST_INCLUDE_FILE deal.IITestfile.cmake
+  )
 
 #
-# Pass all relevant "TEST_" variables down to the subprojects:
+# Pass all relevant "TEST_" and "_DIR" variables down to the subprojects:
 #
+
+SET(_options)
+
+LIST(APPEND _options -DDEAL_II_SOURCE_DIR=${CMAKE_SOURCE_DIR})
+LIST(APPEND _options -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR})
+
 FOREACH(_var TEST_DIR TEST_DIFF TEST_TIME_LIMIT TEST_PICKUP_REGEX NUMDIFF_DIR)
   LIST(APPEND _options "-U${_var}")
   IF(DEFINED ${_var})
@@ -98,16 +111,6 @@ IF(DEAL_II_WITH_UMFPACK)
   LIST(APPEND _categories umfpack)
 ENDIF()
 
-#
-# The hook into CTest so that the tests from the suprojects get picked up
-# by the main project:
-#
-
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/deal.IITestfile.cmake "")
-SET_PROPERTY(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-  APPEND PROPERTY TEST_INCLUDE_FILE deal.IITestfile.cmake
-  )
-
 #
 # Define a subproject for every enabled category:
 #
@@ -125,7 +128,9 @@ FOREACH(_category ${_categories})
     COMMENT "Processing ./tests/${_category}"
     )
   ADD_DEPENDENCIES(setup_test setup_test_${_category})
-  ADD_DEPENDENCIES(setup_test_${_category} library)
+
+  # depend on a valid build directory (libraries built, config in place):
+  ADD_DEPENDENCIES(setup_test_${_category} setup_build_dir)
 
   ADD_CUSTOM_TARGET(clean_test_${_category}
     COMMAND [ ! -d ${_category} ] || ${CMAKE_COMMAND}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.