File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,18 @@ cmake_minimum_required(VERSION 3.13)
3131# Same values than CMAKE_CONFIGURATION_TYPES
3232# From https://gitlab.kitware.com/cmake/cmake/issues/19401
3333get_property (multiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
34+ if (DEFINED CMAKE_BUILD_TYPE )
35+ # Because CMAKE_BUILD_TYPE is not standard for this project, we will restore the original
36+ # after configuring this project
37+ set (RESTORE_CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} )
38+ if (${CMAKE_BUILD_TYPE} STREQUAL "Release" )
39+ set (CMAKE_BUILD_TYPE "release" CACHE STRING "Choose the type of build." )
40+ else if(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo" )
41+ set (CMAKE_BUILD_TYPE "profile" CACHE STRING "Choose the type of build." )
42+ else if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
43+ set (CMAKE_BUILD_TYPE "debug" CACHE STRING "Choose the type of build." )
44+ endif ()
45+ endif ()
3446if (NOT multiConfig AND NOT DEFINED CMAKE_BUILD_TYPE )
3547 set (default_build_type "release" )
3648 message (STATUS "Setting build type to '${default_build_type} ' as none was specified." )
@@ -176,4 +188,8 @@ if(PX_BUILDPUBLICSAMPLES)
176188 message ("Added Samples" )
177189 endif ()
178190endif ()
191+ # Restore the CMAKE_BUILD_TYPE
192+ if (DEFINED RESTORE_CMAKE_BUILD_TYPE)
193+ set (CMAKE_BUILD_TYPE ${RESTORE_CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build." )
194+ endif ()
179195
You can’t perform that action at this time.
0 commit comments