build: add build types helpstring to cmake project
Type: feature
Change-Id: Ia016fee107859d5ad22fe7959c8e9d32758e0787
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b8ffc07..4fa9e5a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -61,6 +61,7 @@
endif()
# release
+list(APPEND BUILD_TYPES "release")
string(CONCAT CMAKE_C_FLAGS_RELEASE
"-O2 "
"-fstack-protector "
@@ -71,6 +72,7 @@
string(CONCAT CMAKE_EXE_LINKER_FLAGS_RELEASE "-pie")
# debug
+list(APPEND BUILD_TYPES "debug")
string(CONCAT CMAKE_C_FLAGS_DEBUG
"-O0 "
"-DCLIB_DEBUG "
@@ -80,9 +82,11 @@
)
# coverity
+list(APPEND BUILD_TYPES "coverity")
string(CONCAT CMAKE_C_FLAGS_COVERITY "-O2 -D__COVERITY__")
# gcov
+list(APPEND BUILD_TYPES "gcov")
string(CONCAT CMAKE_C_FLAGS_GCOV
"-O0 "
"-DCLIB_DEBUG "
@@ -92,6 +96,11 @@
string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UC)
+
+string(REPLACE ";" " " BUILD_TYPES "${BUILD_TYPES}")
+set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
+ HELPSTRING "Build type - valid options are: ${BUILD_TYPES}")
+
##############################################################################
# install config
##############################################################################