Skip to content

Commit b80788b

Browse files
committed
ENH: If not set, choose Release BUILD_TYPE
Prefer to build in Release mode if not set.
1 parent f0c4ee6 commit b80788b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ cmake_minimum_required(VERSION 3.27)
22

33
project(PythonQt LANGUAGES CXX VERSION 3.5.6)
44

5+
#-----------------------------------------------------------------------------
6+
# Set a default build type if none was specified
7+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
8+
message(STATUS "Setting build type to 'Release' as none was specified.")
9+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
10+
mark_as_advanced(CMAKE_BUILD_TYPE)
11+
# Set the possible values of build type for cmake-gui
12+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo")
13+
endif()
14+
#-----------------------------------------------------------------------------
15+
516
enable_testing()
617

718
set(CMAKE_CXX_STANDARD 11)

0 commit comments

Comments
 (0)