comparison CMakeLists.txt @ 834:8081ed84589d

Use static nss from subrepository on windows
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 28 Jul 2014 13:03:45 +0200
parents 3a9b0c75f5a6
children 3ae7ad044566
comparison
equal deleted inserted replaced
833:e1bb60a8129b 834:8081ed84589d
34 find_package(PolarSSL) 34 find_package(PolarSSL)
35 include_directories(${POLARSSL_INCLUDE_DIR}) 35 include_directories(${POLARSSL_INCLUDE_DIR})
36 36
37 find_package(Qt5Widgets) 37 find_package(Qt5Widgets)
38 38
39 find_package(NSS) 39 if (NOT WIN32)
40 find_package(NSS)
41 else ()
42 # Use static NSS for Windows
43 if (NOT EXISTS "${CMAKE_SOURCE_DIR}/nss-cmake-static")
44 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'")
45 endif()
46 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/nss-cmake-static/")
47 set(NSS_STATIC_PATH "${CMAKE_SOURCE_DIR}/nss-cmake-static")
48 include (nss-cmake-static)
49 endif()
40 50
41 # Use cmake's automoc and make sure the generated files are included 51 # Use cmake's automoc and make sure the generated files are included
42 set(CMAKE_AUTOMOC ON) 52 set(CMAKE_AUTOMOC ON)
43 set(CMAKE_INCLUDE_CURRENT_DIR ON) 53 set(CMAKE_INCLUDE_CURRENT_DIR ON)
44 54
58 68
59 # Warn level to be used for privileged parts 69 # Warn level to be used for privileged parts
60 set(WARN_HARDENING_FLAGS " -Wextra -Wconversion -Wformat-security") 70 set(WARN_HARDENING_FLAGS " -Wextra -Wconversion -Wformat-security")
61 71
62 # Hardening flags 72 # Hardening flags
63 set(HARDENING_FLAGS " -Wall -Werror -fstack-protector-all -fno-exceptions") 73 set(HARDENING_FLAGS " -Wall -fstack-protector-all -fno-exceptions")
64 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wstack-protector") 74 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wstack-protector")
65 set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4") 75 set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4")
66 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O0") 76 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O0")
67 77
68 if(ENABLE_PROFILING) 78 if(ENABLE_PROFILING)
97 ${CMAKE_SOURCE_DIR}/common 107 ${CMAKE_SOURCE_DIR}/common
98 ) 108 )
99 add_dependencies(static_check flawfinder) 109 add_dependencies(static_check flawfinder)
100 endif (FLAWFINDER_PATH) 110 endif (FLAWFINDER_PATH)
101 111
112 if(WIN32)
113 add_subdirectory(nss-cmake-static)
114 add_definitions(-D_WIN32_WINNT=0x0600) # Windows vista. NSS defines its own winver.
115 endif()
116
117 # No chance to compile nss with -Werror
118 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
119 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
120
102 add_subdirectory(common) 121 add_subdirectory(common)
103 122
104 add_subdirectory(cinst) 123 add_subdirectory(cinst)
105 if(Qt5Widgets_FOUND) 124 if(Qt5Widgets_FOUND)
106 add_subdirectory(ui) 125 add_subdirectory(ui)
111 # Documentation 130 # Documentation
112 configure_file (doc/Doxyfile.in doc/Doxyfile) 131 configure_file (doc/Doxyfile.in doc/Doxyfile)
113 add_subdirectory(doc) 132 add_subdirectory(doc)
114 133
115 # Configure packaging script for testing 134 # Configure packaging script for testing
116 list(GET NSS_LIBRARIES 1 NSS_BASE_DIR)
117 get_filename_component(NSS_BASE_DIR ${NSS_BASE_DIR} PATH)
118
119 set(NSS_BASE_DIR "${NSS_BASE_DIR}/..")
120 configure_file (packaging/tmp-createpackage.sh.in packaging/tmp-createpackage.sh @ONLY) 135 configure_file (packaging/tmp-createpackage.sh.in packaging/tmp-createpackage.sh @ONLY)
121 configure_file (packaging/create-dist-package.sh.in packaging/create-dist-package.sh @ONLY) 136 configure_file (packaging/create-dist-package.sh.in packaging/create-dist-package.sh @ONLY)
122 configure_file (packaging/linux-createpackage.sh.in packaging/linux-createpackage.sh @ONLY) 137 configure_file (packaging/linux-createpackage.sh.in packaging/linux-createpackage.sh @ONLY)
123 configure_file (packaging/linux-installer.inc.in packaging/linux-installer.inc @ONLY) 138 configure_file (packaging/linux-installer.inc.in packaging/linux-installer.inc @ONLY)
124 configure_file (packaging/linux-installer.l10n-de packaging/linux-installer.l10n-de COPYONLY) 139 configure_file (packaging/linux-installer.l10n-de packaging/linux-installer.l10n-de COPYONLY)

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