1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(context-provider)
3 INCLUDE(GNUInstallDirs)
4 SET(target "context-provider")
5 SET(compile_defs "LOG_TAG=\"CONTEXT\"")
9 ${CMAKE_CURRENT_SOURCE_DIR}/include
11 ADD_DEFINITIONS(-O2 -Wall -fPIC -fvisibility=hidden -Wl,--as-needed)
14 SET(dependencies libcontext-shared libcontext-server)
17 IF("${PROFILE}" STREQUAL "mobile")
18 ADD_DEFINITIONS("-D_MOBILE_")
19 ENDIF("${PROFILE}" STREQUAL "mobile")
21 IF("${PROFILE}" STREQUAL "wearable")
22 ADD_DEFINITIONS("-D_WEARABLE_")
23 ENDIF("${PROFILE}" STREQUAL "wearable")
25 IF("${PROFILE}" STREQUAL "tv")
26 ADD_DEFINITIONS("-D_TV_")
27 ENDIF("${PROFILE}" STREQUAL "tv")
31 MESSAGE("Compile definitions: ${compile_defs}")
34 INCLUDE(FindPkgConfig)
35 PKG_CHECK_MODULES(DEPS REQUIRED ${dependencies})
37 FOREACH(flag ${DEPS_CFLAGS})
38 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
41 ADD_LIBRARY(${target} SHARED ${sources})
42 TARGET_LINK_LIBRARIES(${target} ${DEPS_LDFLAGS})
43 SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS})
44 SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "${compile_defs}")
45 SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER})
46 SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER})
49 FOREACH(item IN LISTS dependencies)
50 SET(deps_str "${deps_str} ${item}")
53 SET(VERSION ${FULLVER})
54 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
55 SET(PC_NAME ${PROJECT_NAME})
56 SET(PC_DESCRIPTION "Tizen Context Framework Context Provider")
57 SET(PC_INCLUDE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/context-service")
58 SET(PC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
59 SET(PC_CFLAGS "-I\${includedir}/context-service")
60 SET(PC_LDFLAGS "-l${target}")
61 SET(PC_REQUIRED "${deps_str}")
65 ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc
71 DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
72 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/context-service/internal
73 FILES_MATCHING PATTERN "*.h"
75 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
76 INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries)