|
|
@@ -32,24 +32,16 @@ a CMake < 3.9. Making a guess if this is a multi-config generator.")
|
|
|
endif()
|
|
|
endif()
|
|
|
|
|
|
-# Define the type of build we are setting up.
|
|
|
-set(_configs Standard Release RelWithDebInfo Debug MinSizeRel)
|
|
|
-if(CMAKE_CXX_COMPILER_ID MATCHES "(AppleClang|Clang|GCC)")
|
|
|
- list(APPEND _configs Coverage)
|
|
|
-endif()
|
|
|
-
|
|
|
+# Set the default CMAKE_BUILD_TYPE before calling project().
|
|
|
if(IS_MULTICONFIG)
|
|
|
message(STATUS "Using multi-configuration generator")
|
|
|
- set(CMAKE_CONFIGURATION_TYPES "${_configs}" CACHE STRING "")
|
|
|
else()
|
|
|
- # Set the default CMAKE_BUILD_TYPE before calling project().
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
set(CMAKE_BUILD_TYPE Standard CACHE STRING "Choose the type of build." FORCE)
|
|
|
message(STATUS "Using default build type ${CMAKE_BUILD_TYPE}")
|
|
|
else()
|
|
|
message(STATUS "Using build type ${CMAKE_BUILD_TYPE}")
|
|
|
endif()
|
|
|
- set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${_configs})
|
|
|
endif()
|
|
|
|
|
|
# Set defaults for macOS, must be before project().
|
|
|
@@ -76,6 +68,20 @@ project(Panda3D VERSION ${_version})
|
|
|
unset(_version)
|
|
|
unset(_s)
|
|
|
|
|
|
+# Determine the possible build types. Must be *after* calling project().
|
|
|
+set(_configs Standard Release RelWithDebInfo Debug MinSizeRel)
|
|
|
+if(CMAKE_CXX_COMPILER_ID MATCHES "(AppleClang|Clang|GCC)")
|
|
|
+ list(APPEND _configs Coverage)
|
|
|
+endif()
|
|
|
+
|
|
|
+message("available configs are ${_configs}")
|
|
|
+
|
|
|
+if(IS_MULTICONFIG)
|
|
|
+ set(CMAKE_CONFIGURATION_TYPES "${_configs}" CACHE STRING "" FORCE)
|
|
|
+else()
|
|
|
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${_configs})
|
|
|
+endif()
|
|
|
+
|
|
|
enable_testing()
|
|
|
|
|
|
string(REPLACE "$(EFFECTIVE_PLATFORM_NAME)" "" PANDA_CFG_INTDIR "${CMAKE_CFG_INTDIR}")
|