If not defined using CLI CMake set the variable CMAKE_BUILD_TYPE
to an empty value. As it is a CACHE variable it can't be
overwritten except if you force it. This fix setting this variable
the first defined value wins:
CLI > Config.cmake > Default value (DEBUG)
Change-Id: I7ff3c9063febf71b898fa7f19058ce2fb25fae01
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
INCLUDE(CheckLibraryExists)
INCLUDE(GNUInstallDirs)
-set(CMAKE_BUILD_TYPE Debug CACHE STRING "the type of build")
+if(NOT CMAKE_BUILD_TYPE)
+ if(BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE ${BUILD_TYPE} CACHE STRING "the type of build" FORCE)
+ else()
+ set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "the type of build" FORCE)
+ endif()
+endif()
+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMP0048 1)
# Compilation Mode (DEBUG, RELEASE)
# ----------------------------------
-#set(CMAKE_BUILD_TYPE "DEBUG")
+#set(BUILD_TYPE "DEBUG")
#set(USE_EFENCE 1)
# Kernel selection if needed. You can choose between a