Fix white-space character in popup
[platform/upstream/csr-framework.git] / src / CMakeLists.txt
1 # Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
2 #
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
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14 #
15 # @file        CMakeLists.txt
16 # @author      Kyungwook Tak (k.tak@samsung.com)
17 # @brief       Make server daemon and client library
18 #
19
20 ###############     SERVER     ###################
21
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)
31
32 PKG_CHECK_MODULES(${TARGET_CSR_SERVER}_DEP
33         REQUIRED
34         libsystemd-daemon
35         sqlite3
36         pkgmgr
37         pkgmgr-info
38         ${AC_BACKEND_REQUIRE}
39 )
40
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
58
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
65
66         ${AC_BACKEND_SRCS}
67 )
68
69 INCLUDE_DIRECTORIES(
70         framework
71         ${PROJECT_SOURCE_DIR}/src/include
72         ${${TARGET_CSR_SERVER}_DEP_INCLUDE_DIRS}
73 )
74
75 SET_SOURCE_FILES_PROPERTIES(${${TARGET_CSR_SERVER}_SRCS}
76         PROPERTIES
77                 COMPILE_FLAGS "-D_GNU_SOURCE -fPIE"
78 )
79
80 ADD_EXECUTABLE(${TARGET_CSR_SERVER} ${${TARGET_CSR_SERVER}_SRCS})
81
82 TARGET_LINK_LIBRARIES(${TARGET_CSR_SERVER}
83         ${${TARGET_CSR_SERVER}_DEP_LIBRARIES}
84         ${TARGET_CSR_COMMON}
85         -ldl
86         -pthread
87         -pie
88 )
89
90 INSTALL(TARGETS ${TARGET_CSR_SERVER} DESTINATION ${BIN_DIR})
91
92 ###############      CLIENT     ###################
93 PKG_CHECK_MODULES(${TARGET_CSR_CLIENT}_DEP
94         REQUIRED
95         capi-base-common
96 )
97
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
108 )
109
110 INCLUDE_DIRECTORIES(
111         framework
112         ${PROJECT_SOURCE_DIR}/src/include
113         ${${TARGET_CSR_CLIENT}_DEP_INCLUDE_DIRS}
114 )
115
116 ADD_LIBRARY(${TARGET_CSR_CLIENT} SHARED ${${TARGET_CSR_CLIENT}_SRCS})
117
118 SET_TARGET_PROPERTIES(${TARGET_CSR_CLIENT}
119         PROPERTIES
120                 COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden"
121                 SOVERSION ${API_VERSION}
122                 VERSION ${VERSION}
123 )
124
125 TARGET_LINK_LIBRARIES(${TARGET_CSR_CLIENT}
126         ${${TARGET_CSR_CLIENT}_DEP_LIBRARIES}
127         ${TARGET_CSR_COMMON}
128 )
129
130 INSTALL(TARGETS ${TARGET_CSR_CLIENT} DESTINATION ${LIB_INSTALL_DIR})
131
132 ADD_SUBDIRECTORY(include)
133 ADD_SUBDIRECTORY(framework)