annotate CMakeLists.txt @ 1331:8897c90b8166

(issue108) Remove generate_cppcheck and cppcheck target This did not work correctly. It is better just to manually execute cppcheck on the files as it gives you more control over the options.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 15 Oct 2014 13:24:59 +0200
parents 05d4b2b8f22a
children c64b6c56ce96
rev   line source
405
35d6b371ba63 Add License header for CMake and shell scripts
Andre Heinecke <aheinecke@intevation.de>
parents: 363
diff changeset
1 # Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
35d6b371ba63 Add License header for CMake and shell scripts
Andre Heinecke <aheinecke@intevation.de>
parents: 363
diff changeset
2 # Software engineering by Intevation GmbH
35d6b371ba63 Add License header for CMake and shell scripts
Andre Heinecke <aheinecke@intevation.de>
parents: 363
diff changeset
3 #
35d6b371ba63 Add License header for CMake and shell scripts
Andre Heinecke <aheinecke@intevation.de>
parents: 363
diff changeset
4 # This file is Free Software under the GNU GPL (v>=2)
35d6b371ba63 Add License header for CMake and shell scripts
Andre Heinecke <aheinecke@intevation.de>
parents: 363
diff changeset
5 # and comes with ABSOLUTELY NO WARRANTY!
35d6b371ba63 Add License header for CMake and shell scripts
Andre Heinecke <aheinecke@intevation.de>
parents: 363
diff changeset
6 # See LICENSE.txt for details.
35d6b371ba63 Add License header for CMake and shell scripts
Andre Heinecke <aheinecke@intevation.de>
parents: 363
diff changeset
7
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
8 cmake_minimum_required(VERSION 2.8.8)
409
09bb19e5e369 Remove m13 mentions and change test certificate to intevation.de
Andre Heinecke <aheinecke@intevation.de>
parents: 405
diff changeset
9 project(trustbridge)
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
10
34
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
11 option(DO_RELEASE_BUILD "Build for a public release." OFF)
37
00aa5fa3c2fb Build System maintainance. Correct integration of Polarssl.
Andre Heinecke <aheinecke@intevation.de>
parents: 34
diff changeset
12 option(ENABLE_PROFILING "Set to enable profiling." OFF)
952
e33a061977c8 (issue41) Default to curl also on Windows.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 933
diff changeset
13 option(USE_CURL "Use libcurl to download updates and certificate lists." ON)
1264
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
14 option(USE_CLANG "Use clang to compile trustbridge." OFF)
34
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
15
1088
508c96e72f62 (issue124) Switch server URL and remove some RELEASE_BUILD options
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
16 set(DOWNLOAD_SERVER "https://tb-devel.intevation.de:443" CACHE STRING "Used as download server" )
26
cbd57d767dfa Move layout around. Restructure CMakeLists
Andre Heinecke <andre.heinecke@intevation.de>
parents: 25
diff changeset
17 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
cbd57d767dfa Move layout around. Restructure CMakeLists
Andre Heinecke <andre.heinecke@intevation.de>
parents: 25
diff changeset
18
74
7ed285380301 Add cmake policy for adding qtmain on Windows
Andre Heinecke <aheinecke@intevation.de>
parents: 58
diff changeset
19 #Old qtmain linking behavior to be compatible with cmake versions < 2.8.11
106
37198bd07182 Check for policy CMP0020 before setting it
Andre Heinecke <aheinecke@intevation.de>
parents: 104
diff changeset
20
37198bd07182 Check for policy CMP0020 before setting it
Andre Heinecke <aheinecke@intevation.de>
parents: 104
diff changeset
21 if(POLICY CMP0020)
37198bd07182 Check for policy CMP0020 before setting it
Andre Heinecke <aheinecke@intevation.de>
parents: 104
diff changeset
22 cmake_policy(SET CMP0020 OLD)
37198bd07182 Check for policy CMP0020 before setting it
Andre Heinecke <aheinecke@intevation.de>
parents: 104
diff changeset
23 endif()
74
7ed285380301 Add cmake policy for adding qtmain on Windows
Andre Heinecke <aheinecke@intevation.de>
parents: 58
diff changeset
24
1264
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
25 if (USE_CLANG)
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
26 message (STATUS "Using clang options to build trustbridge.")
1266
a548dd9a5dbe Fix c++ build with CLANG
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1264
diff changeset
27 # This is a bit of a hack but necessary on Ubuntu 14.4
a548dd9a5dbe Fix c++ build with CLANG
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1264
diff changeset
28 include_directories(/usr/include/c++/4.8 /usr/include/x86_64-linux-gnu/c++/4.8/)
1264
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
29 endif()
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
30
24
de67047ca229 Add documentation generation
Andre Heinecke <aheinecke@intevation.de>
parents: 22
diff changeset
31 include(CTest)
495
7a8f5b85fd9a Dynamically generate version information from HG
Andre Heinecke <aheinecke@intevation.de>
parents: 409
diff changeset
32 include(HGVersion)
7a8f5b85fd9a Dynamically generate version information from HG
Andre Heinecke <aheinecke@intevation.de>
parents: 409
diff changeset
33
7a8f5b85fd9a Dynamically generate version information from HG
Andre Heinecke <aheinecke@intevation.de>
parents: 409
diff changeset
34 if(HG_REVISION)
1129
6950f08342bb Add CMakeList changes for r1127
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1118
diff changeset
35 If(HG_REVISION_DIST STREQUAL "0")
6950f08342bb Add CMakeList changes for r1127
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1118
diff changeset
36 add_definitions(-DIS_TAG_BUILD)
6950f08342bb Add CMakeList changes for r1127
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1118
diff changeset
37 endif()
495
7a8f5b85fd9a Dynamically generate version information from HG
Andre Heinecke <aheinecke@intevation.de>
parents: 409
diff changeset
38 set(PROJECT_VERSION ${HG_REVISION})
7a8f5b85fd9a Dynamically generate version information from HG
Andre Heinecke <aheinecke@intevation.de>
parents: 409
diff changeset
39 else()
7a8f5b85fd9a Dynamically generate version information from HG
Andre Heinecke <aheinecke@intevation.de>
parents: 409
diff changeset
40 set(PROJECT_VERSION unknown)
7a8f5b85fd9a Dynamically generate version information from HG
Andre Heinecke <aheinecke@intevation.de>
parents: 409
diff changeset
41 endif()
7a8f5b85fd9a Dynamically generate version information from HG
Andre Heinecke <aheinecke@intevation.de>
parents: 409
diff changeset
42
7a8f5b85fd9a Dynamically generate version information from HG
Andre Heinecke <aheinecke@intevation.de>
parents: 409
diff changeset
43 add_definitions(-DVERSION="${PROJECT_VERSION}")
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
44
34
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
45 find_package(PolarSSL)
104
2a031ac963b0 Check for qt before including UI
Andre Heinecke <aheinecke@intevation.de>
parents: 75
diff changeset
46 include_directories(${POLARSSL_INCLUDE_DIR})
2a031ac963b0 Check for qt before including UI
Andre Heinecke <aheinecke@intevation.de>
parents: 75
diff changeset
47
2a031ac963b0 Check for qt before including UI
Andre Heinecke <aheinecke@intevation.de>
parents: 75
diff changeset
48 find_package(Qt5Widgets)
34
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
49
1071
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 994
diff changeset
50 find_program(OSSLSIGNCODE_EXECUTABLE osslsigncode)
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 994
diff changeset
51
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 994
diff changeset
52 if (WIN32 AND NOT OSSLSIGNCODE_EXECUTABLE)
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 994
diff changeset
53 message (STATUS "WARNING: osslsigncode not found. Code verification and code verification tests will fail.")
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 994
diff changeset
54 endif()
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 994
diff changeset
55
834
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
56 if (NOT WIN32)
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
57 find_package(NSS)
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
58 else ()
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
59 # Use static NSS for Windows
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
60 if (NOT EXISTS "${CMAKE_SOURCE_DIR}/nss-cmake-static")
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
61 MESSAGE(FATAL_ERROR "Could not find nss-cmake-static checkout. Please run: \n hg clone https://wald.intevation.org/hg/trustbridge/nss-cmake-static '${CMAKE_SOURCE_DIR}/nss-cmake-static'")
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
62 endif()
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
63 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/nss-cmake-static/")
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
64 set(NSS_STATIC_PATH "${CMAKE_SOURCE_DIR}/nss-cmake-static")
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
65 include (nss-cmake-static)
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
66 endif()
307
2fd69803d219 Complete InstRemove NSS test
Andre Heinecke <andre.heinecke@intevation.de>
parents: 171
diff changeset
67
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
68 # Use cmake's automoc and make sure the generated files are included
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
69 set(CMAKE_AUTOMOC ON)
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
70 set(CMAKE_INCLUDE_CURRENT_DIR ON)
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
71
34
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
72 if(DO_RELEASE_BUILD)
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
73 if (NOT CMAKE_BUILD_TYPE)
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
74 set (CMAKE_BUILD_TYPE RELEASE)
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
75 endif (NOT CMAKE_BUILD_TYPE)
171
04c1e0188ac3 Fixed RELEASE_BUILD define.
Sascha Wilde <wilde@intevation.de>
parents: 106
diff changeset
76 add_definitions (-DRELEASE_BUILD)
1093
153af47456d0 Add option "USE_REAL_RESOURCES" to avoid the if 1 dance for test/release builds.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1088
diff changeset
77 set(USE_REAL_RESOURCES ON)
34
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
78 else()
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents: 4
diff changeset
79 # Default to debug build
34
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
80 if (NOT CMAKE_BUILD_TYPE)
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
81 set (CMAKE_BUILD_TYPE Debug)
58
ad61489ce593 Set -g for debug builds
Andre Heinecke <aheinecke@intevation.de>
parents: 37
diff changeset
82 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
ad61489ce593 Set -g for debug builds
Andre Heinecke <aheinecke@intevation.de>
parents: 37
diff changeset
83 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
34
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
84 endif (NOT CMAKE_BUILD_TYPE)
bee7d274c4dc Check for polarssl. Add release option to build with other certificates
Andre Heinecke <andre.heinecke@intevation.de>
parents: 26
diff changeset
85 endif()
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents: 4
diff changeset
86
1093
153af47456d0 Add option "USE_REAL_RESOURCES" to avoid the if 1 dance for test/release builds.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1088
diff changeset
87 if(USE_REAL_RESOURCES)
153af47456d0 Add option "USE_REAL_RESOURCES" to avoid the if 1 dance for test/release builds.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1088
diff changeset
88 add_definitions (-DUSE_REAL_RESOURCES)
153af47456d0 Add option "USE_REAL_RESOURCES" to avoid the if 1 dance for test/release builds.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1088
diff changeset
89 endif()
153af47456d0 Add option "USE_REAL_RESOURCES" to avoid the if 1 dance for test/release builds.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1088
diff changeset
90
1264
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
91 if (NOT USE_CLANG)
1
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
92 # Warn level to be used for privileged parts
1264
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
93 set(WARN_HARDENING_FLAGS " -Wextra -Wconversion -Wformat-security")
1
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
94
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
95 # Hardening flags
1264
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
96 set(HARDENING_FLAGS " -Wall -fstack-protector-all -fno-exceptions")
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
97 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wstack-protector")
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
98 set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4")
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
99 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O0")
1299
05d4b2b8f22a Add weverything for CLANG build
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1266
diff changeset
100 else()
05d4b2b8f22a Add weverything for CLANG build
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1266
diff changeset
101 set(HARDENING_FLAGS " -Weverything")
1264
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
102 endif()
24
de67047ca229 Add documentation generation
Andre Heinecke <aheinecke@intevation.de>
parents: 22
diff changeset
103
37
00aa5fa3c2fb Build System maintainance. Correct integration of Polarssl.
Andre Heinecke <aheinecke@intevation.de>
parents: 34
diff changeset
104 if(ENABLE_PROFILING)
00aa5fa3c2fb Build System maintainance. Correct integration of Polarssl.
Andre Heinecke <aheinecke@intevation.de>
parents: 34
diff changeset
105 set(PROFILING_FLAGS "-fprofile-arcs -ftest-coverage")
00aa5fa3c2fb Build System maintainance. Correct integration of Polarssl.
Andre Heinecke <aheinecke@intevation.de>
parents: 34
diff changeset
106 set(PROFILING_LIBS gcov)
00aa5fa3c2fb Build System maintainance. Correct integration of Polarssl.
Andre Heinecke <aheinecke@intevation.de>
parents: 34
diff changeset
107 endif()
26
cbd57d767dfa Move layout around. Restructure CMakeLists
Andre Heinecke <andre.heinecke@intevation.de>
parents: 25
diff changeset
108
363
d10d9bc2e84f Update Windows api usage. Warning: To build on windows you need
Andre Heinecke <aheinecke@intevation.de>
parents: 307
diff changeset
109 if(WIN32)
d10d9bc2e84f Update Windows api usage. Warning: To build on windows you need
Andre Heinecke <aheinecke@intevation.de>
parents: 307
diff changeset
110 add_definitions(-D_WIN32_WINNT=0x0600) # Windows vista
d10d9bc2e84f Update Windows api usage. Warning: To build on windows you need
Andre Heinecke <aheinecke@intevation.de>
parents: 307
diff changeset
111 add_definitions(-DWINVER=0x0600)
d10d9bc2e84f Update Windows api usage. Warning: To build on windows you need
Andre Heinecke <aheinecke@intevation.de>
parents: 307
diff changeset
112 add_definitions(-DMINGW_HAS_SECURE_API) # for _s functions
d10d9bc2e84f Update Windows api usage. Warning: To build on windows you need
Andre Heinecke <aheinecke@intevation.de>
parents: 307
diff changeset
113 endif(WIN32)
d10d9bc2e84f Update Windows api usage. Warning: To build on windows you need
Andre Heinecke <aheinecke@intevation.de>
parents: 307
diff changeset
114
1264
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
115 if(UNIX AND NOT USE_CLANG)
4
9849250f50f2 Start implementation of certificatelist parser
Andre Heinecke <aheinecke@intevation.de>
parents: 1
diff changeset
116 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -pie -fPIE -ftrapv")
9849250f50f2 Start implementation of certificatelist parser
Andre Heinecke <aheinecke@intevation.de>
parents: 1
diff changeset
117 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,-z,relro,-z,now")
1264
3cd8dd706aaa Add possibility to build with CLANG and document it.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1220
diff changeset
118 elseif(WIN32 AND NOT USE_CLANG)
4
9849250f50f2 Start implementation of certificatelist parser
Andre Heinecke <aheinecke@intevation.de>
parents: 1
diff changeset
119 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,--dynamicbase -Wl,--nxcompat")
0
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
120 endif()
cb0cde2c5eb9 Initial commit. Basically a Hello World with a Tray Icon.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
121
75
ec0f4efefb7b Add profiling options for all C/CXX code if requested
Andre Heinecke <aheinecke@intevation.de>
parents: 74
diff changeset
122 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS} ${PROFILING_FLAGS}")
ec0f4efefb7b Add profiling options for all C/CXX code if requested
Andre Heinecke <aheinecke@intevation.de>
parents: 74
diff changeset
123 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARN_HARDENING_FLAGS} ${HARDENING_FLAGS} ${PROFILING_FLAGS}")
1
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
124
37
00aa5fa3c2fb Build System maintainance. Correct integration of Polarssl.
Andre Heinecke <aheinecke@intevation.de>
parents: 34
diff changeset
125 add_custom_target(static_check)
00aa5fa3c2fb Build System maintainance. Correct integration of Polarssl.
Andre Heinecke <aheinecke@intevation.de>
parents: 34
diff changeset
126
1
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
127 # FlawFinder
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
128 find_program(FLAWFINDER_PATH flawfinder DOC "flawfinder path")
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
129 if (FLAWFINDER_PATH)
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
130 add_custom_target(flawfinder COMMENT "FlawFinder" VERBATIM COMMAND ${FLAWFINDER_PATH}
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
131 ${CMAKE_SOURCE_DIR}/ui
18
f4f957c58e0a Move listuitol and add cert pinning with a test certificate
Andre Heinecke <aheinecke@intevation.de>
parents: 13
diff changeset
132 ${CMAKE_SOURCE_DIR}/cinst
25
92108a2120f1 Move certificatelist to common. Add cinst directory
Andre Heinecke <aheinecke@intevation.de>
parents: 24
diff changeset
133 ${CMAKE_SOURCE_DIR}/common
1
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
134 )
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
135 add_dependencies(static_check flawfinder)
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
136 endif (FLAWFINDER_PATH)
524cd4908656 Build infrastructure
Andre Heinecke <aheinecke@intevation.de>
parents: 0
diff changeset
137
834
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
138 if(WIN32)
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
139 add_subdirectory(nss-cmake-static)
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
140 add_definitions(-D_WIN32_WINNT=0x0600) # Windows vista. NSS defines its own winver.
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
141 endif()
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
142
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
143 # No chance to compile nss with -Werror
1266
a548dd9a5dbe Fix c++ build with CLANG
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1264
diff changeset
144 if (NOT USE_CLANG)
a548dd9a5dbe Fix c++ build with CLANG
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1264
diff changeset
145 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
a548dd9a5dbe Fix c++ build with CLANG
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1264
diff changeset
146 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
a548dd9a5dbe Fix c++ build with CLANG
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1264
diff changeset
147 endif()
834
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 795
diff changeset
148
1220
60927efa48cc (issue128) Add manifest for the correct execution level.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1185
diff changeset
149 # Cmake does not correctly identify gcc windres when cross compiling
60927efa48cc (issue128) Add manifest for the correct execution level.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1185
diff changeset
150 # making this line neccessary to set the correct flags for it.
60927efa48cc (issue128) Add manifest for the correct execution level.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1185
diff changeset
151 # See: http://public.kitware.com/Bug/view.php?id=11773
60927efa48cc (issue128) Add manifest for the correct execution level.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1185
diff changeset
152 SET(CMAKE_RC_COMPILE_OBJECT
60927efa48cc (issue128) Add manifest for the correct execution level.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1185
diff changeset
153 "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -Ocoff <SOURCE> <OBJECT>")
60927efa48cc (issue128) Add manifest for the correct execution level.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1185
diff changeset
154
618
7dfa4555fb89 Include common before ui to make common targets known
Andre Heinecke <andre.heinecke@intevation.de>
parents: 557
diff changeset
155 add_subdirectory(common)
7dfa4555fb89 Include common before ui to make common targets known
Andre Heinecke <andre.heinecke@intevation.de>
parents: 557
diff changeset
156
25
92108a2120f1 Move certificatelist to common. Add cinst directory
Andre Heinecke <aheinecke@intevation.de>
parents: 24
diff changeset
157 add_subdirectory(cinst)
104
2a031ac963b0 Check for qt before including UI
Andre Heinecke <aheinecke@intevation.de>
parents: 75
diff changeset
158 if(Qt5Widgets_FOUND)
2a031ac963b0 Check for qt before including UI
Andre Heinecke <aheinecke@intevation.de>
parents: 75
diff changeset
159 add_subdirectory(ui)
2a031ac963b0 Check for qt before including UI
Andre Heinecke <aheinecke@intevation.de>
parents: 75
diff changeset
160 else()
2a031ac963b0 Check for qt before including UI
Andre Heinecke <aheinecke@intevation.de>
parents: 75
diff changeset
161 message(STATUS "WARNING: Could not find qt. GUI parts will not be built.")
2a031ac963b0 Check for qt before including UI
Andre Heinecke <aheinecke@intevation.de>
parents: 75
diff changeset
162 endif()
2a031ac963b0 Check for qt before including UI
Andre Heinecke <aheinecke@intevation.de>
parents: 75
diff changeset
163
24
de67047ca229 Add documentation generation
Andre Heinecke <aheinecke@intevation.de>
parents: 22
diff changeset
164 # Documentation
1185
69f7d302cdb9 Fix build with changed documentation paths
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1129
diff changeset
165 configure_file (doc/apidoc/Doxyfile.in doc/apidoc/Doxyfile)
69f7d302cdb9 Fix build with changed documentation paths
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1129
diff changeset
166 add_subdirectory(doc/apidoc)
495
7a8f5b85fd9a Dynamically generate version information from HG
Andre Heinecke <aheinecke@intevation.de>
parents: 409
diff changeset
167
933
af27328bea9d (issue89) Add sphinx integration for the build system.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 914
diff changeset
168 find_package(Sphinx)
af27328bea9d (issue89) Add sphinx integration for the build system.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 914
diff changeset
169
af27328bea9d (issue89) Add sphinx integration for the build system.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 914
diff changeset
170 if (NOT SPHINX_FOUND)
af27328bea9d (issue89) Add sphinx integration for the build system.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 914
diff changeset
171 message (STATUS "WARNING could not find sphinx (Package python-sphinx). Manuals will not be built.")
af27328bea9d (issue89) Add sphinx integration for the build system.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 914
diff changeset
172 else()
1185
69f7d302cdb9 Fix build with changed documentation paths
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1129
diff changeset
173 add_subdirectory(doc/help)
933
af27328bea9d (issue89) Add sphinx integration for the build system.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 914
diff changeset
174 endif()
af27328bea9d (issue89) Add sphinx integration for the build system.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 914
diff changeset
175
1010
1c1964c27b39 (issue54) commit work in progress on start after installation
Andre Heinecke <andre.heinecke@intevation.de>
parents: 994
diff changeset
176 add_subdirectory(packaging)
557
5cd525fc91de Add lcov target to generate coverage report
Andre Heinecke <aheinecke@intevation.de>
parents: 500
diff changeset
177
5cd525fc91de Add lcov target to generate coverage report
Andre Heinecke <aheinecke@intevation.de>
parents: 500
diff changeset
178 if (ENABLE_PROFILING)
5cd525fc91de Add lcov target to generate coverage report
Andre Heinecke <aheinecke@intevation.de>
parents: 500
diff changeset
179 configure_file (make-coverage.sh.in make-coverage.sh)
5cd525fc91de Add lcov target to generate coverage report
Andre Heinecke <aheinecke@intevation.de>
parents: 500
diff changeset
180 add_custom_target(lcov COMMENT "Lcov coverage report" VERBATIM COMMAND /bin/bash
5cd525fc91de Add lcov target to generate coverage report
Andre Heinecke <aheinecke@intevation.de>
parents: 500
diff changeset
181 ${CMAKE_CURRENT_BINARY_DIR}/make-coverage.sh
5cd525fc91de Add lcov target to generate coverage report
Andre Heinecke <aheinecke@intevation.de>
parents: 500
diff changeset
182 )
5cd525fc91de Add lcov target to generate coverage report
Andre Heinecke <aheinecke@intevation.de>
parents: 500
diff changeset
183 endif()

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