Add FileSystem class.
[platform/core/security/key-manager.git] / src / CMakeLists.txt
1 PKG_CHECK_MODULES(KEY_MANAGER_DEP
2     dlog
3     openssl
4     libsmack
5     libsystemd-daemon
6     REQUIRED
7     )
8
9 SET(KEY_MANAGER_SRC_PATH ${PROJECT_SOURCE_DIR}/src)
10 SET(KEY_MANAGER_PATH ${PROJECT_SOURCE_DIR}/src/manager)
11
12 SET(KEY_MANAGER_SOURCES
13     ${KEY_MANAGER_PATH}/main/key-manager-util.cpp
14     ${KEY_MANAGER_PATH}/main/generic-socket-manager.cpp
15     ${KEY_MANAGER_PATH}/main/socket-manager.cpp
16     ${KEY_MANAGER_PATH}/main/key-manager-main.cpp
17     ${KEY_MANAGER_PATH}/service/echo.cpp
18     ${KEY_MANAGER_PATH}/service/ckm-service.cpp
19     ${KEY_MANAGER_PATH}/service/ckm-logic.cpp
20     ${KEY_MANAGER_PATH}/service/key-provider.cpp
21     ${KEY_MANAGER_PATH}/service/ocsp.cpp
22     ${KEY_MANAGER_PATH}/service/DBCryptoModule.cpp
23     ${KEY_MANAGER_PATH}/service/CryptoService.cpp
24     ${KEY_MANAGER_PATH}/service/FileSystem.cpp
25     )
26
27 SET_SOURCE_FILES_PROPERTIES(
28     ${KEY_MANAGER_SOURCES}
29     PROPERTIES
30         COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden")
31
32 INCLUDE_DIRECTORIES(SYSTEM
33     ${KEY_MANAGER_DEP_INCLUDE_DIRS}
34     )
35
36 INCLUDE_DIRECTORIES(
37     ${KEY_MANAGER_SRC_PATH}/include
38     ${KEY_MANAGER_PATH}/main
39     ${KEY_MANAGER_PATH}/common
40     ${KEY_MANAGER_PATH}/service
41     ${KEY_MANAGER_PATH}/dpl/core/include
42     ${KEY_MANAGER_PATH}/dpl/log/include
43     )
44
45 ADD_EXECUTABLE(${TARGET_KEY_MANAGER} ${KEY_MANAGER_SOURCES})
46
47 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER}
48     ${KEY_MANAGER_DEP_LIBRARIES}
49     ${TARGET_KEY_MANAGER_COMMON}
50         ${TARGET_KEY_MANAGER_KEY_PROVIDER}
51     )
52
53
54
55 ################################################################################
56
57 SET(KEY_MANAGER_CLIENT_VERSION_MAJOR 1)
58 SET(KEY_MANAGER_CLIENT_VERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}.0.1)
59
60 SET(KEY_MANAGER_CLIENT_SRC_PATH ${KEY_MANAGER_PATH}/client)
61
62 INCLUDE_DIRECTORIES(
63     ${KEY_MANAGER_PATH}/client
64     ${KEY_MANAGER_PATH}/common
65     ${KEY_MANAGER_PATH}/dpl/core/include
66     ${KEY_MANAGER_PATH}/dpl/log/include
67     )
68
69 SET(KEY_MANAGER_CLIENT_SOURCES
70     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-certificate.cpp
71     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-control.cpp
72     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-common.cpp
73     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-echo.cpp
74     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-key.cpp
75     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager.cpp
76     ${KEY_MANAGER_CLIENT_SRC_PATH}/client-manager-impl.cpp
77     )
78
79 ADD_LIBRARY(${TARGET_KEY_MANAGER_CLIENT} SHARED ${KEY_MANAGER_CLIENT_SOURCES})
80
81 SET_TARGET_PROPERTIES(
82     ${TARGET_KEY_MANAGER_CLIENT}
83     PROPERTIES
84         COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default" 
85         SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}
86         VERSION ${KEY_MANAGER_CLIENT_VERSION}
87     )
88
89 TARGET_LINK_LIBRARIES(${TARGET_KEY_MANAGER_CLIENT}
90     ${KEY_MANAGER_DEP_LIBRARIES}
91     ${TARGET_KEY_MANAGER_COMMON}
92     )
93
94 ################################################################################
95
96 INSTALL(TARGETS ${TARGET_KEY_MANAGER_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
97
98 INSTALL(TARGETS ${TARGET_KEY_MANAGER} DESTINATION bin)
99
100 INSTALL(FILES
101     ${KEY_MANAGER_SRC_PATH}/include/ckm/key-manager.h
102     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-error.h
103     ${KEY_MANAGER_SRC_PATH}/include/ckm/ckm-type.h
104     DESTINATION /usr/include/ckm/ckm
105     )
106
107 ################################################################################
108
109 ADD_SUBDIRECTORY(manager)