Set build type to Debug if not given (#485)
author박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Tue, 3 Jul 2018 10:51:28 +0000 (19:51 +0900)
committer박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 3 Jul 2018 10:51:28 +0000 (19:51 +0900)
* Set build type to Debug if not given

This will set CMAKE_BUILD_TYPE to "Debug" if not given through arguments
- this will add -g compile option

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* message always

CMakeLists.txt

index d332540..4cc2400 100644 (file)
@@ -15,6 +15,14 @@ macro(nncc_find_package PREFIX)
 endmacro(nncc_find_package)
 
 ###
+### CMake configuration
+###
+if(NOT CMAKE_BUILD_TYPE)
+  set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Type of build" FORCE)
+endif(NOT CMAKE_BUILD_TYPE)
+message(STATUS "Use '${CMAKE_BUILD_TYPE}' configuration")
+
+###
 ### Configuration
 ###
 option(DOWNLOAD_EIGEN "Download Eigen source" ON)