1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 INCLUDE(GNUInstallDirs)
9 FILE(GLOB_RECURSE SRCS src/*.cpp)
10 MESSAGE("Sources: ${SRCS}")
13 SET(DEPS "aul bundle pkgmgr-info libsmack capi-appfw-app-control context-common")
16 INCLUDE(FindPkgConfig)
18 ${CMAKE_SOURCE_DIR}/include
20 ADD_DEFINITIONS(-g -O2 -Wall -fPIC -fvisibility=hidden -Wl,--as-needed)
23 pkg_check_modules(api_pkg REQUIRED ${DEPS})
25 FOREACH(flag ${api_pkg_CFLAGS})
26 SET(API_EXTRA_CFLAGS "${API_EXTRA_CFLAGS} ${flag}")
29 ADD_LIBRARY(${target} SHARED ${SRCS})
30 TARGET_LINK_LIBRARIES(${target} ${api_pkg_LDFLAGS})
31 SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_FLAGS ${API_EXTRA_CFLAGS})
32 SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CONTEXT-API\"")
33 SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER})
34 SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER})
37 INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries)
39 DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/context-service
40 FILES_MATCHING PATTERN "*.h"
43 SET(VERSION ${FULLVER})
44 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
45 SET(PC_NAME ${PROJECT_NAME})
46 SET(PC_INCLUDE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/context-service")
47 SET(PC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
48 SET(PC_DESCRIPTION "Tizen Context Framework Native API")
49 SET(PC_REQUIRED ${DEPS})
50 SET(PC_LDFLAGS -l${target})
51 SET(PC_CFLAGS -I\${includedir}/context-service)
55 ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.pc
58 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)