annotate cinst/CMakeLists.txt @ 1142:148014db2f3b static-libc

(issue126) Commit WIP on static linking libc
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 18 Sep 2014 10:29:38 +0200
parents fc4e1fe4e4d4
children
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
101
7e2d08555112 Make cinst cmakelist relative so it can be used standalone
Andre Heinecke <aheinecke@intevation.de>
parents: 68
diff changeset
8 cmake_minimum_required(VERSION 2.8)
7e2d08555112 Make cinst cmakelist relative so it can be used standalone
Andre Heinecke <aheinecke@intevation.de>
parents: 68
diff changeset
9
25
92108a2120f1 Move certificatelist to common. Add cinst directory
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
10 set(CMAKE_AUTOMOC OFF)
92108a2120f1 Move certificatelist to common. Add cinst directory
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
11
101
7e2d08555112 Make cinst cmakelist relative so it can be used standalone
Andre Heinecke <aheinecke@intevation.de>
parents: 68
diff changeset
12 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../common)
37
00aa5fa3c2fb Build System maintainance. Correct integration of Polarssl.
Andre Heinecke <aheinecke@intevation.de>
parents: 25
diff changeset
13
1142
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
14 set(CMAKE_CXX_FLAGS "${EXTRA_STATIC_FLAGS}")
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
15
25
92108a2120f1 Move certificatelist to common. Add cinst directory
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
16 set(CINST_SOURCES
137
4904fe01055d Factor out windows specific parts
Andre Heinecke <aheinecke@intevation.de>
parents: 124
diff changeset
17 ${CMAKE_CURRENT_SOURCE_DIR}/windowsstore.c
302
fac7e1b0e558 Add nss store calling function and use it in cinst
Andre Heinecke <andre.heinecke@intevation.de>
parents: 242
diff changeset
18 ${CMAKE_CURRENT_SOURCE_DIR}/nssstore_linux.c
324
eff8e7ce4dae Add first compiling implementation of nssstore_win.c
Andre Heinecke <aheinecke@intevation.de>
parents: 307
diff changeset
19 ${CMAKE_CURRENT_SOURCE_DIR}/nssstore_win.c
101
7e2d08555112 Make cinst cmakelist relative so it can be used standalone
Andre Heinecke <aheinecke@intevation.de>
parents: 68
diff changeset
20 ${CMAKE_CURRENT_SOURCE_DIR}/main.c
25
92108a2120f1 Move certificatelist to common. Add cinst directory
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
21 )
223
d29997e09177 NSS first Blood. Added code to list certs in found stores.
Sascha Wilde <wilde@intevation.de>
parents: 196
diff changeset
22 add_executable(cinst ${CINST_SOURCES})
25
92108a2120f1 Move certificatelist to common. Add cinst directory
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
23
68
8ffbb48528ae Add certificate installation for windows
Andre Heinecke <aheinecke@intevation.de>
parents: 59
diff changeset
24 if (WIN32)
363
d10d9bc2e84f Update Windows api usage. Warning: To build on windows you need
Andre Heinecke <aheinecke@intevation.de>
parents: 324
diff changeset
25 set(WIN_EXTRA_LIBS -lcrypt32 -luserenv -lshell32)
68
8ffbb48528ae Add certificate installation for windows
Andre Heinecke <aheinecke@intevation.de>
parents: 59
diff changeset
26 endif(WIN32)
37
00aa5fa3c2fb Build System maintainance. Correct integration of Polarssl.
Andre Heinecke <aheinecke@intevation.de>
parents: 25
diff changeset
27
1142
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
28 #if(EXISTS "${CMAKE_PREFIX_PATH}/lib/libc.a")
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
29 # message(status "Linking against static libc: ${CMAKE_PREFIX_PATH}/lib/libc.a")
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
30 # set (LIBC_STATIC "${CMAKE_PREFIX_PATH}/lib/libc.a" "${CMAKE_PREFIX_PATH}/lib/libpthread.a")
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
31 #endif()
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
32
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
33 message(fatal "cmake prefix ${CMAKE_PREFIX_PATH}")
37
00aa5fa3c2fb Build System maintainance. Correct integration of Polarssl.
Andre Heinecke <aheinecke@intevation.de>
parents: 25
diff changeset
34 target_link_libraries(cinst
408
ac9e95ef6966 rename m13_common to trustbridge_common
Andre Heinecke <aheinecke@intevation.de>
parents: 405
diff changeset
35 trustbridge_common
37
00aa5fa3c2fb Build System maintainance. Correct integration of Polarssl.
Andre Heinecke <aheinecke@intevation.de>
parents: 25
diff changeset
36 ${PROFILING_LIBS}
68
8ffbb48528ae Add certificate installation for windows
Andre Heinecke <aheinecke@intevation.de>
parents: 59
diff changeset
37 ${POLARSSL_LIBRARIES}
1142
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
38 ${WIN_EXTRA_LIBS}
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
39 ${LIBC_STATIC}
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
40 pthread
148014db2f3b (issue126) Commit WIP on static linking libc
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1071
diff changeset
41 )
68
8ffbb48528ae Add certificate installation for windows
Andre Heinecke <aheinecke@intevation.de>
parents: 59
diff changeset
42
124
2d50ff378367 Add install targets
Andre Heinecke <aheinecke@intevation.de>
parents: 122
diff changeset
43 install(TARGETS cinst DESTINATION bin)
1019
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
44 if (WIN32)
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
45 add_custom_command(
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
46 TARGET cinst
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
47 POST_BUILD
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
48 COMMAND ${CMAKE_STRIP} cinst.exe
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
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: 1019
diff changeset
50 if (NOT RELEASE_BUILD)
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
51 add_custom_command(
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
52 TARGET cinst
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
53 POST_BUILD
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
54 COMMAND ${OSSLSIGNCODE_EXECUTABLE} sign -certs ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.pem
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
55 -key ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.key
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
56 -h sha256 -in ${CMAKE_CURRENT_BINARY_DIR}/cinst.exe
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
57 -out ${CMAKE_CURRENT_BINARY_DIR}/cinst-signed.exe &&
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
58 mv ${CMAKE_CURRENT_BINARY_DIR}/cinst-signed.exe ${CMAKE_CURRENT_BINARY_DIR}/cinst.exe
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
59 )
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
60 endif()
1019
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
61 else()
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
62 add_custom_command(
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
63 TARGET cinst
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
64 POST_BUILD
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
65 COMMAND strip cinst
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
66 )
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
67 endif()
124
2d50ff378367 Add install targets
Andre Heinecke <aheinecke@intevation.de>
parents: 122
diff changeset
68
223
d29997e09177 NSS first Blood. Added code to list certs in found stores.
Sascha Wilde <wilde@intevation.de>
parents: 196
diff changeset
69 # ----------------------------------------------------------------------
d29997e09177 NSS first Blood. Added code to list certs in found stores.
Sascha Wilde <wilde@intevation.de>
parents: 196
diff changeset
70 # Mozilla nss store specific certificate installer:
834
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
71 set(MOZILLA_SOURCES
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
72 ${CMAKE_CURRENT_SOURCE_DIR}/nss-secitemlist.c
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
73 ${CMAKE_CURRENT_SOURCE_DIR}/mozilla.c
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
74 )
223
d29997e09177 NSS first Blood. Added code to list certs in found stores.
Sascha Wilde <wilde@intevation.de>
parents: 196
diff changeset
75
834
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
76 if(WIN32 OR NSS_FOUND)
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
77 include_directories(${NSS_INCLUDE_DIRS})
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
78 add_executable(mozilla ${MOZILLA_SOURCES})
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
79 target_link_libraries(mozilla
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
80 trustbridge_common
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
81 ${POLARSSL_LIBRARIES}
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
82 ${NSS_LIBRARIES}
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
83 ${PROFILING_LIBS})
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
84 set_target_properties(mozilla PROPERTIES COMPILE_FLAGS "-std=c99")
8081ed84589d Use static nss from subrepository on windows
Andre Heinecke <andre.heinecke@intevation.de>
parents: 408
diff changeset
85 install(TARGETS mozilla DESTINATION bin)
1019
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
86
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
87 if (WIN32)
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
88 add_custom_command(
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
89 TARGET mozilla
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
90 POST_BUILD
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
91 COMMAND ${CMAKE_STRIP} mozilla.exe
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
92 )
1071
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
93 if (NOT RELEASE_BUILD)
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
94 add_custom_command(
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
95 TARGET mozilla
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
96 POST_BUILD
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
97 COMMAND ${OSSLSIGNCODE_EXECUTABLE} sign -certs ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.pem
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
98 -key ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.key
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
99 -h sha256 -in ${CMAKE_CURRENT_BINARY_DIR}/mozilla.exe
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
100 -out ${CMAKE_CURRENT_BINARY_DIR}/mozilla-signed.exe &&
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
101 mv ${CMAKE_CURRENT_BINARY_DIR}/mozilla-signed.exe ${CMAKE_CURRENT_BINARY_DIR}/mozilla.exe
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
102 )
fc4e1fe4e4d4 (issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1019
diff changeset
103 endif()
1019
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
104 else()
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
105 add_custom_command(
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
106 TARGET mozilla
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
107 POST_BUILD
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
108 COMMAND strip mozilla
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
109 )
4f999c7821ce Strip created executables
Andre Heinecke <andre.heinecke@intevation.de>
parents: 834
diff changeset
110 endif()
223
d29997e09177 NSS first Blood. Added code to list certs in found stores.
Sascha Wilde <wilde@intevation.de>
parents: 196
diff changeset
111 else()
d29997e09177 NSS first Blood. Added code to list certs in found stores.
Sascha Wilde <wilde@intevation.de>
parents: 196
diff changeset
112 message(STATUS "WARNING: Could not find nss. Mozilla cert installer will not be build!")
d29997e09177 NSS first Blood. Added code to list certs in found stores.
Sascha Wilde <wilde@intevation.de>
parents: 196
diff changeset
113 endif()

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