comparison CMakeLists.txt @ 34:bee7d274c4dc

Check for polarssl. Add release option to build with other certificates
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 14 Mar 2014 08:58:18 +0100
parents cbd57d767dfa
children 00aa5fa3c2fb
comparison
equal deleted inserted replaced
33:25c08d63d2b7 34:bee7d274c4dc
1 cmake_minimum_required(VERSION 2.8.8) 1 cmake_minimum_required(VERSION 2.8.8)
2 project(m13) 2 project(m13)
3
4 option(DO_RELEASE_BUILD "Build for a public release." OFF)
3 5
4 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") 6 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
5 7
6 include(CTest) 8 include(CTest)
7 include(GenerateCppcheck) 9 include(GenerateCppcheck)
8 10
11 find_package(PolarSSL)
12
9 # Use cmake's automoc and make sure the generated files are included 13 # Use cmake's automoc and make sure the generated files are included
10 set(CMAKE_AUTOMOC ON) 14 set(CMAKE_AUTOMOC ON)
11 set(CMAKE_INCLUDE_CURRENT_DIR ON) 15 set(CMAKE_INCLUDE_CURRENT_DIR ON)
12 16
17 if(DO_RELEASE_BUILD)
18 if (NOT CMAKE_BUILD_TYPE)
19 set (CMAKE_BUILD_TYPE RELEASE)
20 endif (NOT CMAKE_BUILD_TYPE)
21 add_definitions (RELEASE_BUILD)
22 else()
13 # Default to debug build 23 # Default to debug build
14 if (NOT CMAKE_BUILD_TYPE) 24 if (NOT CMAKE_BUILD_TYPE)
15 set (CMAKE_BUILD_TYPE Debug) 25 set (CMAKE_BUILD_TYPE Debug)
16 endif (NOT CMAKE_BUILD_TYPE) 26 endif (NOT CMAKE_BUILD_TYPE)
27 endif()
17 28
18 # Warn level to be used for privileged parts 29 # Warn level to be used for privileged parts
19 set(WARN_HARDENING_FLAGS " -Wextra -Wconversion -Wformat-security") 30 set(WARN_HARDENING_FLAGS " -Wextra -Wconversion -Wformat-security")
20 31
21 # Hardening flags 32 # Hardening flags
24 set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4") 35 set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4")
25 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O0") 36 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O0")
26 37
27 # Uncomment to enable profiling 38 # Uncomment to enable profiling
28 # set(PROFILING_FLAGS "-fprofile-arcs -ftest-coverage") 39 # set(PROFILING_FLAGS "-fprofile-arcs -ftest-coverage")
40 # set(PROFILING_LIBS gcov)
29 41
30 SET(CMAKE_EXE_LINKER_FLAGS=${PROFILING_FLAGS}) 42 SET(CMAKE_EXE_LINKER_FLAGS=${PROFILING_FLAGS})
31 43
32 if(UNIX) 44 if(UNIX)
33 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -pie -fPIE -ftrapv") 45 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -pie -fPIE -ftrapv")

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