1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
4 SET(DEPENDENTS "vconf glib-2.0 gio-2.0 dlog")
5 SET(VERSION ${FULLVER})
6 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
7 SET(EXEC_PREFIX "${CMAKE_INSTALL_PREFIX}/bin")
9 SET(PC_NAME ${PROJECT_NAME})
10 SET(PC_DESCRIPTION "Sensor Client library")
11 SET(PC_INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/sensor")
12 SET(PC_REQUIRES "${DEPENDENTS}")
13 SET(PC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
14 SET(PC_LDFLAGS "-l${PROJECT_NAME}")
16 INCLUDE(FindPkgConfig)
17 PKG_CHECK_MODULES(PKGS REQUIRED ${DEPENDENTS})
19 FOREACH(flag ${PKGS_CFLAGS})
20 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
23 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -g -fPIC")
27 sensor_internal_deprecated.h
31 ${CMAKE_SOURCE_DIR}/src/hal
32 ${CMAKE_SOURCE_DIR}/src/shared
33 ${CMAKE_CURRENT_SOURCE_DIR}
36 FILE(GLOB_RECURSE SRCS *.cpp)
38 IF("${PROFILE}" STREQUAL "tv")
40 "${CMAKE_CURRENT_SOURCE_DIR}/client.cpp"
41 "${CMAKE_CURRENT_SOURCE_DIR}/external_client.cpp")
44 "${CMAKE_CURRENT_SOURCE_DIR}/client_dummy.cpp"
45 "${CMAKE_CURRENT_SOURCE_DIR}/external_client_dummy.cpp")
48 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
50 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS} "sensord-shared")
51 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJORVER})
52 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${FULLVER})
54 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc @ONLY)
55 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries)
56 FOREACH(HEADER IN ITEMS ${INSTALL_HEADERS})
57 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sensor)
59 INSTALL(FILES ${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)