adding a DEBUG option in cmake to compile wth debug flags

This commit is contained in:
kakwa 2016-08-26 19:28:12 +02:00
parent 16b29c7639
commit 02e493578d
1 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,13 @@ project (uts-server)
set(VERSION 0.1.0)
option(DEBUG "compile with debug symbol" OFF)
if(DEBUG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g")
set(CMAKE_BUILD_TYPE Debug)
endif(DEBUG)
add_custom_target(tag
git tag -a "${VERSION}" -m "version ${VERSION}" &&
git push origin ${VERSION}