Commit a35b6250 authored by Fabio Bas's avatar Fabio Bas
Browse files

Handle correctly user-defined CMAKE_BUILD_TYPE

parent a4fbf8b6
......@@ -13,6 +13,14 @@ set(PROJECT_VERSION_MINOR 0)
set(PROJECT_VERSION_PATCH 1)
set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} )
# Defualt to "Release" build type
# User-provided value for CMAKE_BUILD_TYPE must be checked before the PROJECT() call
IF(DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Type of build")
ELSE()
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Type of build")
ENDIF()
# A project name is needed for CPack
PROJECT("${PROJECT_NAME}")
......@@ -41,9 +49,6 @@ elseif(WIN32)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/release)
endif()
# Force "Release" build type by default
set(CMAKE_BUILD_TYPE Release)
# Define proper compilation flags
IF (CMAKE_COMPILER_IS_GNUCC)
# linux/gcc, bsd/gcc, windows/mingw
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment