1 PKG_CHECK_MODULES(KEY_MANAGER_DEP
12 FIND_PACKAGE(Threads REQUIRED)
14 SET(KEY_MANAGER_SRC_PATH ${PROJECT_SOURCE_DIR}/src)
15 SET(KEY_MANAGER_PATH ${PROJECT_SOURCE_DIR}/src/manager)
17 SET(KEY_MANAGER_SOURCES
18 ${KEY_MANAGER_PATH}/main/key-manager-util.cpp
19 ${KEY_MANAGER_PATH}/main/generic-socket-manager.cpp
20 ${KEY_MANAGER_PATH}/main/socket-manager.cpp
21 ${KEY_MANAGER_PATH}/main/key-manager-main.cpp
22 ${KEY_MANAGER_PATH}/service/ckm-service.cpp
23 ${KEY_MANAGER_PATH}/service/ckm-logic.cpp
24 ${KEY_MANAGER_PATH}/service/key-provider.cpp
25 ${KEY_MANAGER_PATH}/service/ocsp.cpp
26 ${KEY_MANAGER_PATH}/service/crypto-logic.cpp
27 ${KEY_MANAGER_PATH}/service/CryptoService.cpp
28 ${KEY_MANAGER_PATH}/service/file-system.cpp
29 ${KEY_MANAGER_PATH}/service/db-crypto.cpp
30 ${KEY_MANAGER_PATH}/service/ocsp-service.cpp
31 ${KEY_MANAGER_PATH}/service/ocsp-logic.cpp
34 # -fPIE and -pie flag is added for ASLR
35 SET_SOURCE_FILES_PROPERTIES(
36 ${KEY_MANAGER_SOURCES}
38 COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden -fPIE")
40 INCLUDE_DIRECTORIES(SYSTEM
41 ${KEY_MANAGER_DEP_INCLUDE_DIRS}
45 ${KEY_MANAGER_SRC_PATH}/include
46 ${KEY_MANAGER_PATH}/main
47 ${KEY_MANAGER_PATH}/common
48 ${KEY_MANAGER_PATH}/service
49 ${KEY_MANAGER_PATH}/sqlcipher
50 ${KEY_MANAGER_PATH}/dpl/core/include
51 ${KEY_MANAGER_PATH}/dpl/log/include
52 ${KEY_MANAGER_PATH}/dpl/db/include
55 ADD_EXECUTABLE(${TARGET_KEY_MANAGER} ${KEY_MANAGER_SOURCES})
57 # pie flag is added for ASLR
58 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER}
59 ${CMAKE_THREAD_LIBS_INIT}
60 ${KEY_MANAGER_DEP_LIBRARIES}
61 ${TARGET_KEY_MANAGER_COMMON}
65 ################################################################################
67 SET(KEY_MANAGER_CLIENT_VERSION_MAJOR 1)
68 SET(KEY_MANAGER_CLIENT_VERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}.0.1)
70 SET(KEY_MANAGER_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
71 SET(KEY_MANAGER_CLIENT_ASYNC_SRC_PATH ${KEY_MANAGER_PATH}/client-async)
72 SET(KEY_MANAGER_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
75 ${KEY_MANAGER_PATH}/client
76 ${KEY_MANAGER_PATH}/client-async
77 ${KEY_MANAGER_PATH}/client-capi
78 ${KEY_MANAGER_PATH}/common
79 ${KEY_MANAGER_PATH}/dpl/core/include
80 ${KEY_MANAGER_PATH}/dpl/log/include
83 SET(KEY_MANAGER_CLIENT_SOURCES
84 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
85 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-error.cpp
86 ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager-impl.cpp
87 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async.cpp
88 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/client-manager-async-impl.cpp
89 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/connection-thread.cpp
90 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/async-request.cpp
91 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/service.cpp
92 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/storage-receiver.cpp
93 ${KEY_MANAGER_CLIENT_ASYNC_SRC_PATH}/ocsp-receiver.cpp
94 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type.cpp
95 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-error.cpp
96 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-manager.cpp
97 ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
100 ADD_LIBRARY(${TARGET_KEY_MANAGER_CLIENT} SHARED ${KEY_MANAGER_CLIENT_SOURCES})
102 SET_TARGET_PROPERTIES(
103 ${TARGET_KEY_MANAGER_CLIENT}
105 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default"
106 SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}
107 VERSION ${KEY_MANAGER_CLIENT_VERSION}
110 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CLIENT}
111 ${KEY_MANAGER_DEP_LIBRARIES}
112 ${TARGET_KEY_MANAGER_COMMON}
115 ################################################################################
117 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR 1)
118 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}.0.1)
120 SET(KEY_MANAGER_CONTROL_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
121 SET(KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
124 ${KEY_MANAGER_PATH}/client
125 ${KEY_MANAGER_PATH}/client-capi
126 ${KEY_MANAGER_PATH}/common
127 ${KEY_MANAGER_PATH}/dpl/core/include
128 ${KEY_MANAGER_PATH}/dpl/log/include
131 SET(KEY_MANAGER_CONTROL_CLIENT_SOURCES
132 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-control.cpp
133 ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-common.cpp
134 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-control.cpp
135 ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
138 ADD_LIBRARY(${TARGET_KEY_MANAGER_CONTROL_CLIENT} SHARED ${KEY_MANAGER_CONTROL_CLIENT_SOURCES})
140 SET_TARGET_PROPERTIES(
141 ${TARGET_KEY_MANAGER_CONTROL_CLIENT}
143 COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default"
144 SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}
145 VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION}
148 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CONTROL_CLIENT}
149 ${KEY_MANAGER_DEP_LIBRARIES}
150 ${TARGET_KEY_MANAGER_COMMON}
153 ################################################################################
154 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
155 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CONTROL_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
157 INSTALL(TARGETS ${TARGET_KEY_MANAGER} DESTINATION bin)
161 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager.h
162 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager-async.h
163 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-certificate.h
164 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-control.h
165 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-error.h
166 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-key.h
167 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-password.h
168 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-pkcs12.h
169 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-raw-buffer.h
170 ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-type.h
171 DESTINATION /usr/include/ckm/ckm
174 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-manager.h
175 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-control.h
176 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-error.h
177 ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-type.h
178 DESTINATION /usr/include/ckm/ckmc
180 ################################################################################
182 ADD_SUBDIRECTORY(manager)
183 ADD_SUBDIRECTORY(listener)