Migrate to openssl3
[platform/core/security/ode.git] / server / CMakeLists.txt
1 #
2 # Copyright (c) 2015-2019 Samsung Electronics Co., Ltd All Rights Reserved
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 SET(SERVER_SRCS main.cpp
17                                 server.cpp
18                                 misc.cpp
19                                 ext4-tool.cpp
20                                 file-footer.cpp
21                                 file-sink.cpp
22                                 secure-erase.cpp
23                                 progress-bar.cpp
24                                 kernel-keyring.cpp
25                                 internal-encryption.cpp
26                                 internal-encryption-common.cpp
27                                 external-encryption.cpp
28                                 luks.cpp
29                                 key-server.cpp
30                                 engine/encryption/ext4-engine.cpp
31                                 engine/encryption/dmcrypt-engine.cpp
32                                 engine/encryption/ecryptfs-engine.cpp
33                                 engine/encryption/cryptsetup-engine.cpp
34                                 engine/erase/mmc-engine.cpp
35                                 engine/erase/erase-engine.cpp
36                                 key-manager/key-store.cpp
37                                 key-manager/key-generator.cpp
38                                 key-manager/anti-forensics.cpp
39                                 key-manager/encrypted-key.cpp
40                                 upgrade-support.cpp
41 )
42
43 SET(DEPENDENCY  klay
44                                 vconf
45                                 glib-2.0
46                                 gio-2.0
47                                 libtzplatform-config
48                                 cynara-client
49                                 openssl3
50                                 libsmack
51                                 capi-system-device
52                                 libsystemd
53                                 ext2fs
54                                 com_err
55 )
56
57 SET(SERVER_NAME ${PROJECT_NAME}d)
58 SET(PROJECT_DATA_DIR ${DATA_DIR}/${PROJECT_NAME})
59
60 ADD_EXECUTABLE(${SERVER_NAME} ${SERVER_SRCS})
61
62 PKG_CHECK_MODULES(SERVER_DEPS REQUIRED ${DEPENDENCY})
63
64 INCLUDE_DIRECTORIES(SYSTEM ${SERVER_DEPS_INCLUDE_DIRS} ${ODE_SERVER} ${PROJECT_SOURCE_DIR})
65
66 TARGET_LINK_LIBRARIES(${SERVER_NAME} ${SERVER_DEPS_LIBRARIES} ${LFS_LDFLAGS} ${LFS_LIBS} pthread dl)
67
68 SET_TARGET_PROPERTIES(${SERVER_NAME} PROPERTIES COMPILE_FLAGS "-fPIE")
69 SET_TARGET_PROPERTIES(${SERVER_NAME} PROPERTIES LINK_FLAGS "-pie -Wl,-z,relro")
70 ADD_DEFINITIONS(-DPROJECT_DATA_DIR="${PROJECT_DATA_DIR}")
71
72 TARGET_COMPILE_DEFINITIONS(${SERVER_NAME} PRIVATE
73         RUN_PATH="${RUN_DIR}"
74         ICON_PATH="${ICON_DIR}"
75 )
76
77 CONFIGURE_FILE(systemd/${PROJECT_NAME}.service.in systemd/${PROJECT_NAME}.service)
78 CONFIGURE_FILE(systemd/${PROJECT_NAME}.socket.in systemd/${PROJECT_NAME}.socket)
79 CONFIGURE_FILE(dbus/${DBUS_NAME}.service.in dbus/${DBUS_NAME}.service)
80
81 INSTALL(TARGETS ${SERVER_NAME} DESTINATION ${BIN_DIR})
82 INSTALL(FILES systemd/${PROJECT_NAME}.service systemd/${PROJECT_NAME}.socket DESTINATION ${SYSTEMD_UNIT_DIR})
83 INSTALL(FILES dbus/${DBUS_NAME}.service DESTINATION ${DBUS_SYSTEM_SERVICES_DIR})
84 INSTALL(FILES dbus/${DBUS_NAME}.conf DESTINATION ${DBUS_CONF_DIR})
85 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/engine/encryption/dummy_password DESTINATION ${PROJECT_DATA_DIR})
86 INSTALL(DIRECTORY DESTINATION ${KEY_STORAGE_PLUGIN_DIR})