Remove profile build dependencies
[platform/core/context/context-service.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(context-service)
3 INCLUDE(GNUInstallDirs)
4
5 # Targets
6 SET(target "contextd")
7
8 # Source Lists
9 FILE(GLOB_RECURSE SRCS src/*.cpp)
10 MESSAGE("Sources: ${SRCS}")
11
12 # Dependencies
13 SET(DEPS
14         gmodule-2.0
15         vconf
16         cynara-creds-gdbus
17         cynara-client
18         cynara-session
19         capi-system-device
20         capi-appfw-app-manager
21         capi-appfw-package-manager
22         notification
23         context-common
24         context
25 )
26
27 # Common Options
28 INCLUDE(FindPkgConfig)
29 INCLUDE_DIRECTORIES(
30         /usr/include
31         /usr/include/glib-2.0
32 )
33 ADD_DEFINITIONS(-O2 -Wall -fPIC -fPIE -fdata-sections -ffunction-sections -fvisibility=hidden)
34 ADD_DEFINITIONS(-DLOG_TAG="CONTEXT")
35 ADD_DEFINITIONS(-D_LIBDIR_="${LIBDIR}")
36 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -pie -Wl,--as-needed -Wl,--gc-section -Wl,--print-gc-section")
37
38 # Building Daemon
39 pkg_check_modules(daemon_pkg REQUIRED ${DEPS})
40
41 FOREACH(flag ${daemon_pkg_CFLAGS})
42         SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
43 ENDFOREACH(flag)
44
45 ADD_EXECUTABLE(${target} ${SRCS})
46 TARGET_LINK_LIBRARIES(${target} ${daemon_pkg_LDFLAGS})
47
48 # Installing Daemon
49 INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_BINDIR})