From ea887407aa643257ef477cf1b4a19669dbe25d28 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 21 Apr 2009 14:27:34 +0000 Subject: [PATCH] From Eric Sokolowsky, "I found that the current CMakeLists.txt doesn't set the debugging flags correctly on OSX when using cmake to generate Xcode projects. This change has the potential to affect all platforms, so it should be tested." --- CMakeLists.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31464b5de..57974a9f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -468,15 +468,13 @@ SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows") ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX=${CMAKE_DEBUG_POSTFIX}) IF(UNIX AND NOT WIN32) - IF(CMAKE_BUILD_TYPE STREQUAL "Debug") - ADD_DEFINITIONS("-D_DEBUG") - ENDIF() + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") ENDIF() IF(CYGWIN) - IF(CMAKE_BUILD_TYPE STREQUAL "Debug") - ADD_DEFINITIONS("-D_DEBUG") - ENDIF() + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") ENDIF() IF(UNIX AND NOT WIN32 AND NOT APPLE)