1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 INCLUDE(GNUInstallDirs)
6 SET(target ${PROJECT_NAME})
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 INCLUDE(FindPkgConfig)
18 ${CMAKE_SOURCE_DIR}/include
20 ADD_DEFINITIONS(-O2 -Wall -fPIC -fdata-sections -ffunction-sections -fvisibility=hidden)
21 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,--as-needed -Wl,--gc-section -Wl,--print-gc-section")
24 pkg_check_modules(api_pkg REQUIRED ${DEPS})
26 FOREACH(flag ${api_pkg_CFLAGS})
27 SET(API_EXTRA_CFLAGS "${API_EXTRA_CFLAGS} ${flag}")
30 ADD_LIBRARY(${target} SHARED ${SRCS})
31 TARGET_LINK_LIBRARIES(${target} ${api_pkg_LDFLAGS})
32 SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_FLAGS ${API_EXTRA_CFLAGS})
33 SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CONTEXT-API\"")
34 SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER})
35 SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER})
38 INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR})
40 DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/context-service
45 SET(VERSION ${FULLVER})
46 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
47 SET(PC_NAME ${PROJECT_NAME})
48 SET(PC_INCLUDE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/context-service")
49 SET(PC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
50 SET(PC_DESCRIPTION "Tizen Context Framework Native API")
51 SET(PC_REQUIRED ${DEPS})
52 SET(PC_LDFLAGS -l${target})
53 SET(PC_CFLAGS -I\${includedir}/context-service)
57 ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.pc
60 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
62 ADD_SUBDIRECTORY(testsuite)