From 3c976c040b48caa9f3e75d12a6502e39193ce9a6 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Wed, 19 Dec 2012 16:52:11 +0100 Subject: Don't enforce CMake build type on users. Only set CMAKE_BUILD_TYPE to Debug when no value is provided. --- src/CBot/tests/CBot_console/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/CBot/tests/CBot_console/CMakeLists.txt') diff --git a/src/CBot/tests/CBot_console/CMakeLists.txt b/src/CBot/tests/CBot_console/CMakeLists.txt index 7d9f034..3ba118d 100644 --- a/src/CBot/tests/CBot_console/CMakeLists.txt +++ b/src/CBot/tests/CBot_console/CMakeLists.txt @@ -3,7 +3,9 @@ cmake_minimum_required(VERSION 2.8) project(CBot_console C CXX) # Build with debugging symbols -set(CMAKE_BUILD_TYPE debug) +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE debug) +endif(NOT CMAKE_BUILD_TYPE) # Global compile flags set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall -Wold-style-cast -std=gnu++0x") -- cgit v1.2.3-1-g7c22 From 7e9ef0c042fd14373a129ca8a5ac94e9679daee9 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Wed, 19 Dec 2012 16:54:58 +0100 Subject: Put common CXX flags in common variables CMAKE_CXX_FLAGS is taken into account in all builds; build-type-specific flags are appended to it. --- src/CBot/tests/CBot_console/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/CBot/tests/CBot_console/CMakeLists.txt') diff --git a/src/CBot/tests/CBot_console/CMakeLists.txt b/src/CBot/tests/CBot_console/CMakeLists.txt index 3ba118d..9f0f244 100644 --- a/src/CBot/tests/CBot_console/CMakeLists.txt +++ b/src/CBot/tests/CBot_console/CMakeLists.txt @@ -8,8 +8,9 @@ if(NOT CMAKE_BUILD_TYPE) endif(NOT CMAKE_BUILD_TYPE) # Global compile flags -set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall -Wold-style-cast -std=gnu++0x") -set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wold-style-cast -std=gnu++0x") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=gnu++0x") +set(CMAKE_CXX_FLAGS_RELEASE "-O2") +set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") # Include cmake directory SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${colobot_SOURCE_DIR}/cmake") -- cgit v1.2.3-1-g7c22