1 # Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # @file CMakeLists.txt
16 # @author Kyungwook Tak (k.tak@samsung.com)
17 # @brief Make server daemon and client library
20 ############### SERVER ###################
22 IF (PLATFORM_VERSION_3)
23 MESSAGE("Use Cynara as access control backend")
24 SET(AC_BACKEND_REQUIRE cynara-client)
25 SET(AC_BACKEND_SRCS framework/service/access-control-cynara.cpp)
26 ELSE (PLATFORM_VERSION_3)
27 MESSAGE("Use Smack as access control backend")
28 SET(AC_BACKEND_REQUIRE libsmack)
29 SET(AC_BACKEND_SRCS framework/service/access-control-smack.cpp)
30 ENDIF (PLATFORM_VERSION_3)
32 PKG_CHECK_MODULES(${TARGET_CSR_SERVER}_DEP
41 SET(${TARGET_CSR_SERVER}_SRCS
42 framework/main/csr-main.cpp
43 framework/service/logic.cpp
44 framework/service/cs-logic.cpp
45 framework/service/wp-logic.cpp
46 framework/service/em-logic.cpp
47 framework/service/type-converter.cpp
48 framework/service/server-service.cpp
49 framework/service/thread-pool.cpp
50 framework/service/core-usage.cpp
51 framework/service/fs-utils.cpp
52 framework/service/file-system.cpp
53 framework/service/app-deleter.cpp
54 framework/service/cs-loader.cpp
55 framework/service/wp-loader.cpp
56 framework/service/engine-error-converter.cpp
57 framework/ui/askuser.cpp
59 # question and response codes needed on both of
60 # csr-server and popup-backend service
61 framework/ui/common.cpp
62 framework/db/connection.cpp
63 framework/db/statement.cpp
64 framework/db/manager.cpp
71 ${PROJECT_SOURCE_DIR}/src/include
72 ${${TARGET_CSR_SERVER}_DEP_INCLUDE_DIRS}
75 SET_SOURCE_FILES_PROPERTIES(${${TARGET_CSR_SERVER}_SRCS}
77 COMPILE_FLAGS "-D_GNU_SOURCE -fPIE"
80 ADD_EXECUTABLE(${TARGET_CSR_SERVER} ${${TARGET_CSR_SERVER}_SRCS})
82 TARGET_LINK_LIBRARIES(${TARGET_CSR_SERVER}
83 ${${TARGET_CSR_SERVER}_DEP_LIBRARIES}
90 INSTALL(TARGETS ${TARGET_CSR_SERVER} DESTINATION ${BIN_DIR})
92 ############### CLIENT ###################
93 PKG_CHECK_MODULES(${TARGET_CSR_CLIENT}_DEP
98 SET(${TARGET_CSR_CLIENT}_SRCS
99 framework/client/async-logic.cpp
100 framework/client/canonicalize.cpp
101 framework/client/content-screening.cpp
102 framework/client/engine-manager.cpp
103 framework/client/error.cpp
104 framework/client/handle.cpp
105 framework/client/handle-ext.cpp
106 framework/client/utils.cpp
107 framework/client/web-protection.cpp
112 ${PROJECT_SOURCE_DIR}/src/include
113 ${${TARGET_CSR_CLIENT}_DEP_INCLUDE_DIRS}
116 ADD_LIBRARY(${TARGET_CSR_CLIENT} SHARED ${${TARGET_CSR_CLIENT}_SRCS})
118 SET_TARGET_PROPERTIES(${TARGET_CSR_CLIENT}
120 COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden"
121 SOVERSION ${API_VERSION}
125 TARGET_LINK_LIBRARIES(${TARGET_CSR_CLIENT}
126 ${${TARGET_CSR_CLIENT}_DEP_LIBRARIES}
130 INSTALL(TARGETS ${TARGET_CSR_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
132 ADD_SUBDIRECTORY(include)
133 ADD_SUBDIRECTORY(framework)