comparison CMakeLists.txt @ 1093:153af47456d0

Add option "USE_REAL_RESOURCES" to avoid the if 1 dance for test/release builds. If the option is not set the download resource is trustbridge-development.*
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 15 Sep 2014 10:17:17 +0200
parents 508c96e72f62
children fd85a02d771d
comparison
equal deleted inserted replaced
1092:02fd9992ccc9 1093:153af47456d0
7 7
8 cmake_minimum_required(VERSION 2.8.8) 8 cmake_minimum_required(VERSION 2.8.8)
9 project(trustbridge) 9 project(trustbridge)
10 10
11 option(DO_RELEASE_BUILD "Build for a public release." OFF) 11 option(DO_RELEASE_BUILD "Build for a public release." OFF)
12 option(USE_REAL_RESOURCES "Use real resource names on the download server. Autmatically ON if DO_RELEASE_BUILD is set" OFF )
12 option(ENABLE_PROFILING "Set to enable profiling." OFF) 13 option(ENABLE_PROFILING "Set to enable profiling." OFF)
13 option(USE_CURL "Use libcurl to download updates and certificate lists." ON) 14 option(USE_CURL "Use libcurl to download updates and certificate lists." ON)
14 15
15 set(DOWNLOAD_SERVER "https://tb-devel.intevation.de:443" CACHE STRING "Used as download server" ) 16 set(DOWNLOAD_SERVER "https://tb-devel.intevation.de:443" CACHE STRING "Used as download server" )
16 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") 17 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
63 if(DO_RELEASE_BUILD) 64 if(DO_RELEASE_BUILD)
64 if (NOT CMAKE_BUILD_TYPE) 65 if (NOT CMAKE_BUILD_TYPE)
65 set (CMAKE_BUILD_TYPE RELEASE) 66 set (CMAKE_BUILD_TYPE RELEASE)
66 endif (NOT CMAKE_BUILD_TYPE) 67 endif (NOT CMAKE_BUILD_TYPE)
67 add_definitions (-DRELEASE_BUILD) 68 add_definitions (-DRELEASE_BUILD)
69 set(USE_REAL_RESOURCES ON)
68 else() 70 else()
69 # Default to debug build 71 # Default to debug build
70 if (NOT CMAKE_BUILD_TYPE) 72 if (NOT CMAKE_BUILD_TYPE)
71 set (CMAKE_BUILD_TYPE Debug) 73 set (CMAKE_BUILD_TYPE Debug)
72 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") 74 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
73 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") 75 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
74 endif (NOT CMAKE_BUILD_TYPE) 76 endif (NOT CMAKE_BUILD_TYPE)
77 endif()
78
79 if(USE_REAL_RESOURCES)
80 add_definitions (-DUSE_REAL_RESOURCES)
75 endif() 81 endif()
76 82
77 # Warn level to be used for privileged parts 83 # Warn level to be used for privileged parts
78 set(WARN_HARDENING_FLAGS " -Wextra -Wconversion -Wformat-security") 84 set(WARN_HARDENING_FLAGS " -Wextra -Wconversion -Wformat-security")
79 85

http://wald.intevation.org/projects/trustbridge/