Skip to content

Commit

Permalink
Set a default build type ("Release"), if none was specified. Show pos…
Browse files Browse the repository at this point in the history
…sible options on 'cmake-gui' for 'CMAKE_BUILD_TYPE' variable: "Debug", "Release", "MinSizeRel" or "RelWithDebInfo".
  • Loading branch information
pablospe committed Jul 5, 2018
1 parent 5a65178 commit e2a12d3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmake/LibraryConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ else()
set(LIBRARY_TYPE STATIC)
endif()

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release'.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)

# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

# Target
add_library(${LIBRARY_NAME} ${LIBRARY_TYPE} ${SOURCES} ${HEADERS})

Expand Down

0 comments on commit e2a12d3

Please sign in to comment.