]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Bugfix: Throw a verbose error message instead of silently ignoring an argument
authorMatthias Maier <tamiko@43-1.org>
Thu, 8 Sep 2016 19:55:54 +0000 (14:55 -0500)
committerMatthias Maier <tamiko@43-1.org>
Mon, 19 Sep 2016 15:06:44 +0000 (10:06 -0500)
cmake/macros/macro_deal_ii_setup_target.cmake

index f971888f993f5b1362bb7a76e18d07d92fd49a08..c1c96942f860aa7a3fc6c329acad72c8f2b3cf88 100644 (file)
@@ -38,9 +38,8 @@
 #   "${DEAL_II_USER_DEFINITIONS};${DEAL_II_USER_DEFINITIONS_<build type>}"
 #
 # If no "DEBUG" or "RELEASE" keyword is specified after the target, the
-# current CMAKE_BUILD_TYPE determines which compiler and linker flags as
-# well as compile definitions to use and against which deal.II library it
-# should be linked against.
+# current CMAKE_BUILD_TYPE is used instead: Every build type that (case
+# insensitively) matches "debug" is considered a debug build.
 #
 # If the requested build type is not available (e.g. DEBUG request but
 # deal.II was compiled with release mode only), the other available will be
@@ -80,6 +79,11 @@ MACRO(DEAL_II_SETUP_TARGET _target)
   #
   IF("${ARGN}" MATCHES "^(DEBUG|RELEASE)$")
     SET(_build "${ARGN}")
+  ELSEIF(NOT "${ARGN}" STREQUAL "")
+    MESSAGE(FATAL_ERROR
+      "\nDEAL_II_SETUP_TARGET called with invalid second argument.
+      Valid arguments are (empty), DEBUG, or RELEASE\n\n"
+      )
   ENDIF()
 
   #

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.