From 0197cdbf957194a5d769992064c3374f2503f9f0 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Fri, 8 Nov 2024 18:56:18 +0100 Subject: [PATCH] BUILD: Set CMake build type to Debug if none specified --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79b4157..3be03fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,20 @@ option(Boost_USE_STATIC_LIBS "Use Boost static libraries" OFF) option(PHAETHON_BUILD_DOCUMENTATION "Use Doxygen to create the HTML based API documentation" OFF) +# ------------------------------------------------------------------------- +# default build type + +set(default_build_type "Debug") +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to '${default_build_type}' as none was specified.") + set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE + STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() + + # ------------------------------------------------------------------------- # load some cmake modules from cmake/ subfolder list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)