1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 INCLUDE(GNUInstallDirs)
9 FILE(GLOB_RECURSE SRCS src/*.cpp)
10 MESSAGE("Sources: ${SRCS}")
13 SET(DEPS "gio-2.0 context-common aul bundle capi-appfw-app-control pkgmgr-info")
16 ADD_DEFINITIONS(-DSYSTEM_SERVICE)
17 ENDIF(${SYSTEM_SERVICE})
20 INCLUDE(FindPkgConfig)
22 ${CMAKE_SOURCE_DIR}/include
24 ADD_DEFINITIONS(-O2 -Wall -fPIC -fdata-sections -ffunction-sections -fvisibility=hidden)
25 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,--as-needed -Wl,--gc-section -Wl,--print-gc-section")
28 ADD_DEFINITIONS(-DLEGACY_APPFW)
29 ENDIF(${LEGACY_APPFW})
32 pkg_check_modules(api_pkg REQUIRED ${DEPS})
34 FOREACH(flag ${api_pkg_CFLAGS})
35 SET(API_EXTRA_CFLAGS "${API_EXTRA_CFLAGS} ${flag}")
38 ADD_LIBRARY(${target} SHARED ${SRCS})
39 TARGET_LINK_LIBRARIES(${target} ${api_pkg_LDFLAGS})
40 SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_FLAGS ${API_EXTRA_CFLAGS})
41 SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CONTEXT-API\"")
42 SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER})
43 SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER})
46 INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR})
48 DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/context-service
53 SET(VERSION ${FULLVER})
54 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
55 SET(PC_NAME ${PROJECT_NAME})
56 SET(PC_INCLUDE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/context-service")
57 SET(PC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
58 SET(PC_DESCRIPTION "Tizen Context Framework Native API")
59 SET(PC_REQUIRED ${DEPS})
60 SET(PC_LDFLAGS -l${target})
61 SET(PC_CFLAGS -I\${includedir}/context-service)
65 ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.pc
68 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
70 ADD_SUBDIRECTORY(testsuite)