diff --git a/cmake/HiPACEFunctions.cmake b/cmake/HiPACEFunctions.cmake index 2d61e641f9..cf71fc4e5f 100644 --- a/cmake/HiPACEFunctions.cmake +++ b/cmake/HiPACEFunctions.cmake @@ -72,6 +72,10 @@ macro(set_default_build_type default_build_type) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES}) endif() + if(NOT CMAKE_BUILD_TYPE IN_LIST CMAKE_CONFIGURATION_TYPES) + message(WARNING "CMAKE_BUILD_TYPE '${CMAKE_BUILD_TYPE}' is not one of " + "${CMAKE_CONFIGURATION_TYPES}. Is this a typo?") + endif() endif() endmacro() @@ -219,7 +223,12 @@ function(hipace_print_summary) message(" python: ${CMAKE_INSTALL_PYTHONDIR}") endif() message("") - message(" Build type: ${CMAKE_BUILD_TYPE}") + set(BLD_TYPE_UNKNOWN "") + if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR AND + NOT CMAKE_BUILD_TYPE IN_LIST CMAKE_CONFIGURATION_TYPES) + set(BLD_TYPE_UNKNOWN " (unknown type, check warning)") + endif() + message(" Build type: ${CMAKE_BUILD_TYPE}${BLD_TYPE_UNKNOWN}") #if(BUILD_SHARED_LIBS) # message(" Library: shared") #else()