From 7598bc94519c44e7188363ab214f3e328b4af617 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Sat, 18 May 2013 18:02:33 -0400 Subject: [PATCH] CMake: handle DEBUG and NDEBUG options --- CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50f7731..d030c17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)