diff options
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3521ea6..8bbbb20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,21 @@ ################################################################################ # General ################################################################################ +cmake_minimum_required(VERSION 3.15 FATAL_ERROR) + +set(pvs2_BUILD_TYPES Release Debug) +get_property(multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(multi_config) + set(CMAKE_CONFIGURATION_TYPES "${pvs2_BUILD_TYPES}" CACHE STRING "list of supported configuration types" FORCE) +else() + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type of the project.") + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${pvs2_BUILD_TYPES}") + if(NOT CMAKE_BUILD_TYPE IN_LIST pvs2_BUILD_TYPES) + message(FATAL_ERROR "Invalid build type '${CMAKE_BUILD_TYPE}'. Possible values:\n ${pvs2_BUILD_TYPES}") + endif() +endif() PROJECT(pvs2) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR) SET(EXTRA_C_FLAGS "" CACHE STRING "Additional options to pass to C compiler") SET(EXTRA_CXX_FLAGS "" CACHE STRING "Additional options to pass to C++ compiler") |