CMake: handle DEBUG and NDEBUG options

This commit is contained in:
Matteo Cypriani 2013-05-18 18:02:33 -04:00 committed by Matteo Cypriani
parent dad2e543d1
commit 7598bc9451
1 changed files with 17 additions and 0 deletions

View File

@ -14,6 +14,23 @@ set(GENERATED_INCLUDE "${PROJECT_BINARY_DIR}/include")
include_directories("${GENERATED_INCLUDE}")
### Options ###
option (DEBUG
"Enable debug code"
on)
if (DEBUG)
add_definitions(-DDEBUG)
endif (DEBUG)
option (NDEBUG
"Enable no-debug mode (for assert() and others)"
off)
if (NDEBUG)
add_definitions(-DNDEBUG)
endif (NDEBUG)
### Libraries ###
add_subdirectory(libowlps)