From db0fc4d49c36ed51df615f50417f535afc976207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Tue, 5 Feb 2013 16:56:16 +0100 Subject: [PATCH] Add -DDEBUG via add_definitions --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f4efc2ff..bfc6b50ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -828,8 +828,9 @@ if(HAVE_GETOPT) add_definitions(-DHAVE_GETOPT) endif() -set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-DDEBUG) +endif() if(ENABLE_STRIP) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s")