Change systemd-devel package name
[platform/upstream/csr-framework.git] / src / framework / 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 common library for both of server and client
18 #
19
20 MESSAGE("Use Cynara as access control backend")
21 SET(AC_BACKEND_COMMON_REQUIRE cynara-creds-socket)
22 SET(AC_BACKEND_COMMON_SRCS common/credential-cynara.cpp)
23
24 PKG_CHECK_MODULES(${TARGET_CSR_COMMON}_DEP
25         REQUIRED
26         dlog
27         libsystemd
28         ${AC_BACKEND_COMMON_REQUIRE}
29 )
30
31 SET(${TARGET_CSR_COMMON}_SRCS
32         common/audit/console-sink.cpp
33         common/audit/dlog-sink.cpp
34         common/audit/logger.cpp
35         common/binary-queue.cpp
36         common/connection.cpp
37         common/cs-context.cpp
38         common/cs-detected.cpp
39         common/exception.cpp
40         common/wp-context.cpp
41         common/wp-result.cpp
42         common/em-context.cpp
43         common/kvp-container.cpp
44         common/dispatcher.cpp
45         common/native-mainloop.cpp
46         common/service.cpp
47         common/socket.cpp
48         common/socket-descriptor.cpp
49
50         ${AC_BACKEND_COMMON_SRCS}
51 )
52
53 INCLUDE_DIRECTORIES(
54         ./
55         ${PROJECT_SOURCE_DIR}/src/include/csr
56         ${PROJECT_SOURCE_DIR}/src/include/csre
57         ${${TARGET_CSR_COMMON}_DEP_INCLUDE_DIRS}
58 )
59
60 ADD_LIBRARY(${TARGET_CSR_COMMON} SHARED ${${TARGET_CSR_COMMON}_SRCS})
61
62 SET_TARGET_PROPERTIES(${TARGET_CSR_COMMON}
63         PROPERTIES
64                 COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden"
65                 SOVERSION ${API_VERSION}
66                 VERSION ${VERSION}
67 )
68
69 TARGET_LINK_LIBRARIES(${TARGET_CSR_COMMON}
70         ${${TARGET_CSR_COMMON}_DEP_LIBRARIES}
71 )
72
73 INSTALL(TARGETS ${TARGET_CSR_COMMON} DESTINATION ${LIB_INSTALL_DIR})
74
75 ADD_SUBDIRECTORY(ui)