]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Partially revert #1758 3088/head
authorMatthias Maier <tamiko@43-1.org>
Sat, 17 Sep 2016 01:06:00 +0000 (20:06 -0500)
committerMatthias Maier <tamiko@43-1.org>
Mon, 19 Sep 2016 15:06:44 +0000 (10:06 -0500)
 - always set Debug, or Release build type (depending on availability
 - but allow for manually set DebugRelease

cmake/macros/macro_deal_ii_initialize_cached_variables.cmake
cmake/macros/macro_deal_ii_invoke_autopilot.cmake

index 6f406c6356b2d91b95997b996acda3e379a0aebc..fe22952598d9fd79db4aa1e5e5a066e52913a964 100644 (file)
@@ -37,19 +37,30 @@ MACRO(DEAL_II_INITIALIZE_CACHED_VARIABLES)
   ENDIF()
 
   #
-  # Set build type according to build type of deal.II
+  # Set build type according to available libraries
   #
-  SET(CMAKE_BUILD_TYPE ${DEAL_II_BUILD_TYPE} CACHE STRING
-    "Choose the type of build, options are: Debug, Release, DebugRelease")
+  IF(DEAL_II_BUILD_TYPE MATCHES "Debug")
+    SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING
+      "Choose the type of build, options are: Debug, Release"
+      )
+  ELSE()
+    SET(CMAKE_BUILD_TYPE "Release" CACHE STRING
+      "Choose the type of build, options are: Debug, Release"
+      )
+  ENDIF()
 
   #
-  # Reset build type if unsupported, i.e. if it is not (case insensitively
-  # equal to Debug or Release or unsupported by the current build type:
+  # Reset build type if unsupported, i.e. if it is not Debug, Release, or
+  # DebugRelease, or if the library doesn't support it
   #
-  STRING(TOLOWER "${CMAKE_BUILD_TYPE}" _cmake_build_type)
-
-  IF(NOT "${_cmake_build_type}" MATCHES "^(debug|release|debugrelease)$")
+  IF( NOT "${CMAKE_BUILD_TYPE}" MATCHES "^(Debug|Release|DebugRelease)$"
+      OR NOT "${DEAL_II_BUILD_TYPE}" MATCHES "${CMAKE_BUILD_TYPE}" )
 
+    IF("${DEAL_II_BUILD_TYPE}" STREQUAL "DebugRelease")
+      SET(_new_build_type "Debug")
+    ELSE()
+      SET(_new_build_type "${DEAL_II_BUILD_TYPE}")
+    ENDIF()
 
     MESSAGE(
 "###
@@ -57,14 +68,14 @@ MACRO(DEAL_II_INITIALIZE_CACHED_VARIABLES)
 #  WARNING:
 #
 #  CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\" unsupported by current installation!
-#  deal.II was built with CMAKE_BUILD_TYPE \"${DEAL_II_BUILD_TYPE}\".
+#  deal.II was configured with \"${DEAL_II_BUILD_TYPE}\".
 #
-#  CMAKE_BUILD_TYPE is forced to \"${DEAL_II_BUILD_TYPE}\".
+#  CMAKE_BUILD_TYPE was forced to \"${_new_build_type}\".
 #
 ###"
       )
-    SET(CMAKE_BUILD_TYPE ${DEAL_II_BUILD_TYPE} CACHE STRING
-      "Choose the type of build, options are: Debug, Release, DebugRelease"
+    SET(CMAKE_BUILD_TYPE "${_new_build_type}" CACHE STRING
+      "Choose the type of build, options are: Debug, Release"
       FORCE
       )
 
index 4ff78eab1ea0a036f40a63383a67460b24a79b48..ac18d3f10845afd3e52410d5c32b027b7088bf9a 100644 (file)
 
 MACRO(DEAL_II_INVOKE_AUTOPILOT)
 
-  # Set CMAKE_BUILD_TYPE=Debug if both 
-  # Debug and Release mode are given
-  IF("${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease")
-    SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING
-      "Choose the type of build, options are: Debug, Release"
-      FORCE)
-  ENDIF()
-
-
   # Generator specific values:
   IF(CMAKE_GENERATOR MATCHES "Ninja")
     SET(_make_command "$ ninja")

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.