From 9e320a35b4290bc51cf844ce721329aac9d71476 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 8 Sep 2016 14:55:54 -0500 Subject: [PATCH] CMake: Bugfix: Throw a verbose error message instead of silently ignoring an argument --- cmake/macros/macro_deal_ii_setup_target.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/macros/macro_deal_ii_setup_target.cmake b/cmake/macros/macro_deal_ii_setup_target.cmake index f971888f99..c1c96942f8 100644 --- a/cmake/macros/macro_deal_ii_setup_target.cmake +++ b/cmake/macros/macro_deal_ii_setup_target.cmake @@ -38,9 +38,8 @@ # "${DEAL_II_USER_DEFINITIONS};${DEAL_II_USER_DEFINITIONS_}" # # 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() # -- 2.39.5