Remove restrict mechanism.
[platform/core/security/key-manager.git] / src / CMakeLists.txt
1 PKG_CHECK_MODULES(KEY_MANAGER_DEP
2     dlog
3     openssl
4     libsmack
5     libcrypto
6     libsystemd-daemon
7     capi-base-common
8     db-util
9     REQUIRED
10     )
11 FIND_PACKAGE(Threads REQUIRED)
12
13 SET(KEY_MANAGER_SRC_PATH ${PROJECT_SOURCE_DIR}/src)
14 SET(KEY_MANAGER_PATH ${PROJECT_SOURCE_DIR}/src/manager)
15
16 SET(KEY_MANAGER_SOURCES
17     ${KEY_MANAGER_PATH}/main/key-manager-util.cpp
18     ${KEY_MANAGER_PATH}/main/generic-socket-manager.cpp
19     ${KEY_MANAGER_PATH}/main/socket-manager.cpp
20     ${KEY_MANAGER_PATH}/main/key-manager-main.cpp
21     ${KEY_MANAGER_PATH}/service/ckm-service.cpp
22     ${KEY_MANAGER_PATH}/service/ckm-logic.cpp
23     ${KEY_MANAGER_PATH}/service/key-provider.cpp
24     ${KEY_MANAGER_PATH}/service/ocsp.cpp
25     ${KEY_MANAGER_PATH}/service/crypto-logic.cpp
26     ${KEY_MANAGER_PATH}/service/CryptoService.cpp
27     ${KEY_MANAGER_PATH}/service/file-system.cpp
28     ${KEY_MANAGER_PATH}/service/db-crypto.cpp
29     ${KEY_MANAGER_PATH}/service/ocsp-service.cpp
30     ${KEY_MANAGER_PATH}/service/ocsp-logic.cpp
31     )
32
33 SET_SOURCE_FILES_PROPERTIES(
34     ${KEY_MANAGER_SOURCES}
35     PROPERTIES
36         COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden")
37
38 INCLUDE_DIRECTORIES(SYSTEM
39     ${KEY_MANAGER_DEP_INCLUDE_DIRS}
40     )
41
42 INCLUDE_DIRECTORIES(
43     ${KEY_MANAGER_SRC_PATH}/include
44     ${KEY_MANAGER_PATH}/main
45     ${KEY_MANAGER_PATH}/common
46     ${KEY_MANAGER_PATH}/service
47     ${KEY_MANAGER_PATH}/sqlcipher
48     ${KEY_MANAGER_PATH}/dpl/core/include
49     ${KEY_MANAGER_PATH}/dpl/log/include
50     ${KEY_MANAGER_PATH}/dpl/db/include
51     )
52
53 ADD_EXECUTABLE(${TARGET_KEY_MANAGER} ${KEY_MANAGER_SOURCES})
54
55 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER}
56     ${CMAKE_THREAD_LIBS_INIT}
57     ${KEY_MANAGER_DEP_LIBRARIES}
58     ${TARGET_KEY_MANAGER_COMMON}
59     )
60
61 ################################################################################
62
63 SET(KEY_MANAGER_CLIENT_VERSION_MAJOR 1)
64 SET(KEY_MANAGER_CLIENT_VERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}.0.1)
65
66 SET(KEY_MANAGER_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
67 SET(KEY_MANAGER_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
68
69 INCLUDE_DIRECTORIES(
70     ${KEY_MANAGER_PATH}/client
71     ${KEY_MANAGER_PATH}/client-capi
72     ${KEY_MANAGER_PATH}/common
73     ${KEY_MANAGER_PATH}/dpl/core/include
74     ${KEY_MANAGER_PATH}/dpl/log/include
75     )
76
77 SET(KEY_MANAGER_CLIENT_SOURCES
78     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
79     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-error.cpp
80     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager-impl.cpp
81     ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type.cpp
82     ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-error.cpp
83     ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-manager.cpp
84     ${KEY_MANAGER_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
85     ${KEY_MANAGER_PATH}/common/base64.cpp
86     ${KEY_MANAGER_PATH}/common/digest.cpp
87     ${KEY_MANAGER_PATH}/common/protocols.cpp
88     ${KEY_MANAGER_PATH}/common/message-buffer.cpp
89     ${KEY_MANAGER_PATH}/common/smack-check.cpp
90     ${KEY_MANAGER_PATH}/common/certificate-impl.cpp
91     ${KEY_MANAGER_PATH}/common/certificate-store.cpp
92     ${KEY_MANAGER_PATH}/common/key-impl.cpp
93     ${KEY_MANAGER_PATH}/common/pkcs12-impl.cpp
94     ${KEY_MANAGER_PATH}/dpl/log/src/abstract_log_provider.cpp
95     ${KEY_MANAGER_PATH}/dpl/log/src/dlog_log_provider.cpp
96     ${KEY_MANAGER_PATH}/dpl/log/src/log.cpp
97     ${KEY_MANAGER_PATH}/dpl/log/src/old_style_log_provider.cpp
98     ${KEY_MANAGER_PATH}/dpl/core/src/assert.cpp
99     ${KEY_MANAGER_PATH}/dpl/core/src/binary_queue.cpp
100     ${KEY_MANAGER_PATH}/dpl/core/src/colors.cpp
101     ${KEY_MANAGER_PATH}/dpl/core/src/exception.cpp
102     ${KEY_MANAGER_PATH}/dpl/core/src/noncopyable.cpp
103     ${KEY_MANAGER_PATH}/dpl/core/src/serialization.cpp
104     ${KEY_MANAGER_PATH}/dpl/core/src/singleton.cpp
105     ${KEY_MANAGER_PATH}/dpl/core/src/string.cpp
106     ${KEY_MANAGER_PATH}/dpl/core/src/errno_string.cpp
107     )
108
109 ADD_LIBRARY(${TARGET_KEY_MANAGER_CLIENT} SHARED ${KEY_MANAGER_CLIENT_SOURCES})
110
111 SET_TARGET_PROPERTIES(
112     ${TARGET_KEY_MANAGER_CLIENT}
113     PROPERTIES
114         COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default"
115         SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}
116         VERSION ${KEY_MANAGER_CLIENT_VERSION}
117     )
118
119 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CLIENT}
120     ${KEY_MANAGER_DEP_LIBRARIES}
121     )
122
123 ################################################################################
124
125 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR 1)
126 SET(KEY_MANAGER_CONTROL_CLIENT_VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}.0.1)
127
128 SET(KEY_MANAGER_CONTROL_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
129 SET(KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH ${KEY_MANAGER_PATH}/client-capi)
130
131 INCLUDE_DIRECTORIES(
132     ${KEY_MANAGER_PATH}/client
133     ${KEY_MANAGER_PATH}/client-capi
134     ${KEY_MANAGER_PATH}/common
135     ${KEY_MANAGER_PATH}/dpl/core/include
136     ${KEY_MANAGER_PATH}/dpl/log/include
137     )
138
139 SET(KEY_MANAGER_CONTROL_CLIENT_SOURCES
140     ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-control.cpp
141     ${KEY_MANAGER_CONTROL_CLIENT_SRC_PATH}/client-common.cpp
142     ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-control.cpp
143     ${KEY_MANAGER_CONTROL_CLIENT_CAPI_SRC_PATH}/ckmc-type-converter.cpp
144     ${KEY_MANAGER_PATH}/common/base64.cpp
145     ${KEY_MANAGER_PATH}/common/digest.cpp
146     ${KEY_MANAGER_PATH}/common/protocols.cpp
147     ${KEY_MANAGER_PATH}/common/message-buffer.cpp
148     ${KEY_MANAGER_PATH}/common/smack-check.cpp
149     ${KEY_MANAGER_PATH}/common/certificate-impl.cpp
150     ${KEY_MANAGER_PATH}/common/certificate-store.cpp
151     ${KEY_MANAGER_PATH}/common/key-impl.cpp
152     ${KEY_MANAGER_PATH}/dpl/log/src/abstract_log_provider.cpp
153     ${KEY_MANAGER_PATH}/dpl/log/src/dlog_log_provider.cpp
154     ${KEY_MANAGER_PATH}/dpl/log/src/log.cpp
155     ${KEY_MANAGER_PATH}/dpl/log/src/old_style_log_provider.cpp
156     ${KEY_MANAGER_PATH}/dpl/core/src/assert.cpp
157     ${KEY_MANAGER_PATH}/dpl/core/src/binary_queue.cpp
158     ${KEY_MANAGER_PATH}/dpl/core/src/colors.cpp
159     ${KEY_MANAGER_PATH}/dpl/core/src/exception.cpp
160     ${KEY_MANAGER_PATH}/dpl/core/src/noncopyable.cpp
161     ${KEY_MANAGER_PATH}/dpl/core/src/serialization.cpp
162     ${KEY_MANAGER_PATH}/dpl/core/src/singleton.cpp
163     ${KEY_MANAGER_PATH}/dpl/core/src/string.cpp
164     ${KEY_MANAGER_PATH}/dpl/core/src/errno_string.cpp
165     )
166
167 ADD_LIBRARY(${TARGET_KEY_MANAGER_CONTROL_CLIENT} SHARED ${KEY_MANAGER_CONTROL_CLIENT_SOURCES})
168
169 SET_TARGET_PROPERTIES(
170     ${TARGET_KEY_MANAGER_CONTROL_CLIENT}
171     PROPERTIES
172         COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default"
173         SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}
174         VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION}
175     )
176
177 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CONTROL_CLIENT}
178     ${KEY_MANAGER_DEP_LIBRARIES}
179     )
180
181 ################################################################################
182 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
183 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CONTROL_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
184
185 INSTALL(TARGETS ${TARGET_KEY_MANAGER} DESTINATION bin)
186
187
188 INSTALL(FILES
189     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-manager.h
190     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-certificate.h
191     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-control.h
192     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-error.h
193     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-key.h
194     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-password.h
195     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-pkcs12.h
196     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-raw-buffer.h
197     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-type.h
198     DESTINATION /usr/include/ckm/ckm
199     )
200 INSTALL(FILES
201     ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-manager.h
202     ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-control.h
203     ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-error.h
204     ${KEY_MANAGER_SRC_PATH}/include/ckmc/ckmc-type.h
205     DESTINATION /usr/include/ckm/ckmc
206     )
207 ################################################################################
208
209 ADD_SUBDIRECTORY(manager)
210 ADD_SUBDIRECTORY(listener)