summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJuergen Gehring <juergen.gehring@bmw.de>2018-01-25 01:01:22 -0800
committerJuergen Gehring <juergen.gehring@bmw.de>2018-01-25 01:01:22 -0800
commit2fd0625d21f1fa8e6a3adfc89ce9f381a4d33990 (patch)
tree373a6c991944c700ee3ff1fe872daa3f751281d8 /CMakeLists.txt
parent2c259a9cbfa8fbde71ebc62d45684c375311f4fc (diff)
downloadgenivi-common-api-runtime-2fd0625d21f1fa8e6a3adfc89ce9f381a4d33990.tar.gz
capicxx-core-runtime 3.1.12.43.1.12.4
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9aeb97a..7897345 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,10 +42,14 @@ SET(RPM_PACKAGE_VERSION "r0" CACHE STRING "rpm packet version") # used in e.g. c
SET(MAX_LOG_LEVEL "DEBUG" CACHE STRING "maximum log level")
message(STATUS "MAX_LOG_LEVEL is set to value: ${MAX_LOG_LEVEL}")
+# Set a default build type if none was specified
+set(default_build_type "RelWithDebInfo")
if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
- "Choose the type of build, options are: Debug Release." FORCE)
-endif(NOT CMAKE_BUILD_TYPE)
+ message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
+ set(CMAKE_BUILD_TYPE "${default_build_type}" 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()
set(CMAKE_BUILD_TYPE_FOR_SPEC_IN "")
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_FOR_SPEC_IN)
@@ -98,7 +102,7 @@ IF(MSVC)
add_definitions(-DCOMMONAPI_INTERNAL_COMPILATION -DCOMMONAPI_DLL_COMPILATION)
add_compile_options(/EHsc /wd4996)
ELSE ()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector -fasynchronous-unwind-tables -fno-omit-frame-pointer -Werror -DCOMMONAPI_INTERNAL_COMPILATION")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector -fasynchronous-unwind-tables -fno-omit-frame-pointer -Werror -DCOMMONAPI_INTERNAL_COMPILATION")
ENDIF(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOMMONAPI_LOGLEVEL=COMMONAPI_LOGLEVEL_${MAX_LOG_LEVEL}")