summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 69fd9f56f8386008e8e01a0f79cabe54f4a413c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(appcore-agent C)

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)

ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")

SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -Wall")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Werror")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")

SET(CMAKE_SKIP_BUILD_RPATH TRUE)

#################################################################
# Build appcore-agent Library
# ------------------------------
SET(APPCORE_AGENT "appcore-agent")

INCLUDE(FindPkgConfig)
pkg_check_modules(pkg_agent REQUIRED aul dlog capi-appfw-app-control capi-appfw-app-common vconf ecore-core vconf-internal-keys appcore-common capi-system-info)
FOREACH(flag ${pkg_agent_CFLAGS})
	SET(EXTRA_CFLAGS_agent "${EXTRA_CFLAGS_agent} ${flag}")
ENDFOREACH(flag)

AUX_SOURCE_DIRECTORY(src SOURCES)
ADD_LIBRARY(${APPCORE_AGENT} SHARED ${SOURCES})
SET_TARGET_PROPERTIES(${APPCORE_AGENT} PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(${APPCORE_AGENT} PROPERTIES VERSION ${FULLVER})
SET_TARGET_PROPERTIES(${APPCORE_AGENT} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS_agent})
TARGET_LINK_LIBRARIES(${APPCORE_AGENT} ${pkg_agent_LDFLAGS} "-ldl")

CONFIGURE_FILE(${APPCORE_AGENT}.pc.in ${APPCORE_AGENT}.pc @ONLY)

INSTALL(TARGETS ${APPCORE_AGENT} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPCORE_AGENT}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)

CONFIGURE_FILE(capi-appfw-service-application.pc.in capi-appfw-service-application.pc @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/capi-appfw-service-application.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)

INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include/appcore-agent/
	FILES_MATCHING
	PATTERN "*.h"
	)