ENDIF()
#
- # Reset build type if unsupported:
+ # 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:
#
- IF(NOT DEAL_II_BUILD_TYPE MATCHES "${CMAKE_BUILD_TYPE}")
+ STRING(TOLOWER "${CMAKE_BUILD_TYPE}" _cmake_build_type)
+ STRING(TOLOWER "${DEAL_II_BUILD_TYPE}" _deal_ii_build_type)
+
+ IF( NOT "${_cmake_build_type}" MATCHES "^(debug|release)$"
+ OR NOT _deal_ii_build_type MATCHES "${_cmake_build_type}"
+
IF("${DEAL_II_BUILD_TYPE}" STREQUAL "DebugRelease")
SET(_new_build_type "Debug")
ELSE()
)
#
- # Append build type dependend flags and definitions.
+ # Append build type dependent flags and definitions.
#
#
# For this we obey the behaviour of the "optimized" and "debug"
# keywords and this is a bit tricky:
#
- # If the global property DEBUG_CONFIGURATIONS is set all build
- # types that (case insensitive) match one of the listed build types is
- # considered a "debug" build. The rest is "optimized".
+ # If the global property DEBUG_CONFIGURATIONS is set all build types that
+ # (case insensitively) match one of the listed build types is considered
+ # a "debug" build. The rest is "optimized".
#
# Otherwise every build type that (case insensitively) matches "debug" is
# considered a debug build.
ENDIF()
ENDIF()
- IF(_on_debug_build)
+ #
+ # We can only append DEBUG link flags and compile definitions if deal.II
+ # was build with Debug or DebugRelease build type. So test for this:
+ #
+ IF( _on_debug_build
+ AND DEAL_II_BUILD_TYPE MATCHES "Debug" )
SET_PROPERTY(TARGET ${_target} APPEND_STRING PROPERTY
LINK_FLAGS " ${DEAL_II_LINKER_FLAGS_DEBUG}"
)