]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Bugfix, bail out with a prominent error message if the build type for a client...
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 9 Mar 2013 01:22:30 +0000 (01:22 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 9 Mar 2013 01:22:30 +0000 (01:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@28831 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake

index 8b7179637c546e0c0bfbfc9a0c4350a62fb20411..6aa654d35b9116ea47beb6aa78de18ddc542fa8f 100644 (file)
@@ -35,6 +35,9 @@ MACRO(DEAL_II_INITIALIZE_CACHED_VARIABLES)
       )
   ENDIF()
 
+  #
+  # Set build type according to available libraries
+  #
   IF(DEAL_II_BUILD_TYPE MATCHES "Debug")
     SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING
       "Choose the type of build, options are: Debug, Release"
@@ -45,6 +48,25 @@ MACRO(DEAL_II_INITIALIZE_CACHED_VARIABLES)
       )
   ENDIF()
 
+  #
+  # Bail out if build type is unknown...
+  #
+  IF( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND
+      NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" )
+    MESSAGE(FATAL_ERROR
+      "\nCMAKE_BUILD_TYPE does neither match Release nor Debug!\n\n"
+      )
+  ENDIF()
+  #
+  # ... or unsupported
+  #
+  IF(NOT DEAL_II_BUILD_TYPE MATCHES "${CMAKE_BUILD_TYPE}")
+    MESSAGE(FATAL_ERROR "\n"
+      "CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\" unsupported by current installation!\n"
+      "deal.II was build with \"${DEAL_II_BUILD_TYPE}\" only build type.\n\n"
+      )
+  ENDIF()
+
   SET(CMAKE_CXX_COMPILER ${DEAL_II_CXX_COMPILER} CACHE STRING
     "CXX Compiler.")
 

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.