Fix pkg-config files from returning wrong relative paths.
[platform/core/security/vasum.git] / zone-daemon / CMakeLists.txt
1 # Copyright (c) 2014 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 #
16 # @file   CMakeLists.txt
17 # @author Jan Olszak (j.olszak@samsung.com)
18 #
19
20 MESSAGE(STATUS "")
21 MESSAGE(STATUS "Generating makefile for the Zone Daemon...")
22 FILE(GLOB project_SRCS *.cpp *.hpp)
23 FILE(GLOB common_SRCS ${COMMON_FOLDER}/utils/*.cpp  ${COMMON_FOLDER}/utils/*.hpp
24                       ${COMMON_FOLDER}/*.cpp)
25
26 ## Setup target ################################################################
27 SET(ZONE_DAEMON_CODENAME "${PROJECT_NAME}-zone-daemon")
28 ADD_EXECUTABLE(${ZONE_DAEMON_CODENAME} ${project_SRCS} ${common_SRCS})
29
30
31 ## Link libraries ##############################################################
32 FIND_PACKAGE (Boost COMPONENTS program_options system filesystem)
33
34 PKG_CHECK_MODULES(ZONE_DAEMON_DEPS REQUIRED gio-2.0)
35
36 INCLUDE_DIRECTORIES(${COMMON_FOLDER})
37 INCLUDE_DIRECTORIES(${LIBS_FOLDER})
38 INCLUDE_DIRECTORIES(SYSTEM ${ZONE_DAEMON_DEPS_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
39
40 SET_TARGET_PROPERTIES(${ZONE_DAEMON_CODENAME} PROPERTIES
41     COMPILE_FLAGS "-pthread"
42     LINK_FLAGS "-pthread"
43 )
44
45 TARGET_LINK_LIBRARIES(${ZONE_DAEMON_CODENAME} ${ZONE_DAEMON_DEPS_LIBRARIES}
46                       ${Boost_LIBRARIES} Logger SimpleDbus Ipc)
47
48
49 ## Install #####################################################################
50 INSTALL(TARGETS ${ZONE_DAEMON_CODENAME} DESTINATION bin)
51
52 CONFIGURE_FILE(configs/org.tizen.vasum.zone.daemon.conf.in
53                ${CMAKE_BINARY_DIR}/configs/org.tizen.vasum.zone.daemon.conf)
54
55 INSTALL(FILES       ${CMAKE_BINARY_DIR}/configs/org.tizen.vasum.zone.daemon.conf
56         DESTINATION /etc/dbus-1/system.d/)