properly set default value of CMAKE_BUILD_TYPE

Simple set() is not enough because this variable is created with empty
value after cmake starts. We have to force setting value and store in
cache.

Change-Id: I0d018ebe3a9a0a65f6fae5313853857913d84bf7
This commit is contained in:
Artur Harasimiuk
2018-02-14 08:13:34 +01:00
parent 13d04e4623
commit 56b34ee49f

View File

@ -33,7 +33,8 @@ if(TR_DEPRECATED)
endif(TR_DEPRECATED)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type: [Release, ReleaseInternal, Debug]")
message(STATUS "CMAKE_BUILD_TYPE not specified, using Release")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type: [Release, ReleaseInternal, Debug]" FORCE)
endif()
set(CMAKE_C_FLAGS_RELEASEINTERNAL ${CMAKE_C_FLAGS_RELEASE})