Browse Source

CMake: fix missing Coverage config in multi-config generators

rdb 5 years ago
parent
commit
f56f06b65c
2 changed files with 11 additions and 1 deletions
  1. 0 1
      CMakeLists.txt
  2. 11 0
      dtool/Config.cmake

+ 0 - 1
CMakeLists.txt

@@ -40,7 +40,6 @@ endif()
 
 
 if(IS_MULTICONFIG)
 if(IS_MULTICONFIG)
   message(STATUS "Using multi-configuration generator")
   message(STATUS "Using multi-configuration generator")
-  set(CMAKE_CONFIGURATION_TYPES ${_configs})
 else()
 else()
   # Set the default CMAKE_BUILD_TYPE before calling project().
   # Set the default CMAKE_BUILD_TYPE before calling project().
   if(NOT CMAKE_BUILD_TYPE)
   if(NOT CMAKE_BUILD_TYPE)

+ 11 - 0
dtool/Config.cmake

@@ -22,6 +22,17 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
   set(IS_FREEBSD 1)
   set(IS_FREEBSD 1)
 endif()
 endif()
 
 
+# Define the type of build we are setting up.
+
+set(_configs Standard Release RelWithDebInfo Debug MinSizeRel)
+if(DEFINED CMAKE_CXX_FLAGS_COVERAGE)
+  list(APPEND _configs Coverage)
+endif()
+
+if(IS_MULTICONFIG)
+  set(CMAKE_CONFIGURATION_TYPES ${_configs})
+endif()
+
 set(PER_CONFIG_OPTIONS)
 set(PER_CONFIG_OPTIONS)
 
 
 # Are we building with static or dynamic linking?
 # Are we building with static or dynamic linking?