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 libcontext-shared 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 ADD_DEFINITIONS(-DLEGACY_APPFW)
25 ENDIF(${LEGACY_APPFW})
28 pkg_check_modules(api_pkg REQUIRED ${DEPS})
30 FOREACH(flag ${api_pkg_CFLAGS})
31 SET(API_EXTRA_CFLAGS "${API_EXTRA_CFLAGS} ${flag}")
34 ADD_LIBRARY(${target} SHARED ${SRCS})
35 TARGET_LINK_LIBRARIES(${target} ${api_pkg_LDFLAGS})
36 SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_FLAGS ${API_EXTRA_CFLAGS})
37 SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CONTEXT-API\"")
38 SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER})
39 SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER})
42 INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR})
44 DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/context-service
49 SET(VERSION ${FULLVER})
50 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
51 SET(PC_NAME ${PROJECT_NAME})
52 SET(PC_INCLUDE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/context-service")
53 SET(PC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
54 SET(PC_DESCRIPTION "Tizen Context Framework Native API")
55 SET(PC_REQUIRED ${DEPS})
56 SET(PC_LDFLAGS -l${target})
57 SET(PC_CFLAGS -I\${includedir}/context-service)
61 ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.pc
64 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
66 ADD_SUBDIRECTORY(testsuite)