CMAKE_MINIMUM_REQUIRED(VERSION 2.6) SET (this_target osp-locations) SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output) INCLUDE_DIRECTORIES ( ${ROOTSTRAP_ROOT}/usr/include/location inc src /usr/include/osp /usr/include/osp/app /usr/include/osp/base /usr/include/osp/io /usr/include/osp/system /usr/include/osp/security ) SET (${this_target}_SOURCE_FILES src/FLocCoordinates.cpp src/FLocLocationCriteria.cpp src/FLocLocation.cpp src/FLocLocationProvider.cpp src/FLoc_EllipsoidModel.cpp src/FLoc_LocationImpl.cpp src/FLoc_LocationManager.cpp src/FLoc_LocationProviderImpl.cpp src/FLoc_MathUtils.cpp src/FLoc_LocationMonitor.cpp ) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall" ) ## SET C COMPILER FLAGS SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") ## SET CPP COMPILER FLAGS SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}") ## Create Library ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES}) ## SET LINKER FLAGS SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw") TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-uifw") TARGET_LINK_LIBRARIES(${this_target} "-lcapi-location-manager") TARGET_LINK_LIBRARIES(${this_target} "-lpthread") SET_TARGET_PROPERTIES(${this_target} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER} CLEAN_DIRECT_OUTPUT 1 ) ADD_CUSTOM_COMMAND(TARGET ${this_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJORVER} COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} COMMENT "strip ${this_target}" ) INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp FILES_MATCHING PATTERN "*.so*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug FILES_MATCHING PATTERN "*.so*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h") # pkgconfig file CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY) INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig)