CMAKE_MINIMUM_REQUIRED(VERSION 2.6) SET (this_target osp-bluetooth) SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output) INCLUDE_DIRECTORIES( inc src src/inc /usr/include/chromium /usr/include/glib-2.0 /usr/lib/glib-2.0/include /usr/include/system /usr/include/network /usr/include/osp /usr/include/osp/app /usr/include/osp/base /usr/include/osp/io /usr/include/osp/net /usr/include/osp/security /usr/include/osp/system ) SET (${this_target}_SOURCE_FILES src/FNetBtBluetoothDevice.cpp src/FNetBtBluetoothManager.cpp src/FNetBtBluetoothOppClient.cpp src/FNetBtBluetoothOppServer.cpp src/FNetBtBluetoothSppInitiator.cpp src/FNetBtBluetoothSppAcceptor.cpp src/FNetBtBluetoothSppInitiator.cpp src/FNetBtBluetoothHealth.cpp src/FNetBt_BluetoothAdapterUtility.cpp src/FNetBt_BluetoothConnectionEvent.cpp src/FNetBt_BluetoothConnectionEventArg.cpp src/FNetBt_BluetoothDeviceEvent.cpp src/FNetBt_BluetoothDeviceEventArg.cpp src/FNetBt_BluetoothDeviceImpl.cpp src/FNetBt_BluetoothGapSystemAdapter.cpp src/FNetBt_BluetoothHealthEvent.cpp src/FNetBt_BluetoothHealthEventArg.cpp src/FNetBt_BluetoothHealthImpl.cpp src/FNetBt_BluetoothHdpSystemAdapter.cpp src/FNetBt_BluetoothIpcMessages.cpp src/FNetBt_BluetoothIpcProxy.cpp src/FNetBt_BluetoothManagerEvent.cpp src/FNetBt_BluetoothManagerEventArg.cpp src/FNetBt_BluetoothManagerImpl.cpp src/FNetBt_BluetoothOppClientEvent.cpp src/FNetBt_BluetoothOppClientEventArg.cpp src/FNetBt_BluetoothOppClientImpl.cpp src/FNetBt_BluetoothOppServerEvent.cpp src/FNetBt_BluetoothOppServerEventArg.cpp src/FNetBt_BluetoothOppServerImpl.cpp src/FNetBt_BluetoothOppSystemAdapter.cpp src/FNetBt_BluetoothSppAcceptorEvent.cpp src/FNetBt_BluetoothSppAcceptorEventArg.cpp src/FNetBt_BluetoothSppAcceptorImpl.cpp src/FNetBt_BluetoothSppInitiatorEvent.cpp src/FNetBt_BluetoothSppInitiatorEventArg.cpp src/FNetBt_BluetoothSppInitiatorImpl.cpp src/FNetBt_BluetoothSppSystemAdapter.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 -Wl,--no-undefined) TARGET_LINK_LIBRARIES(${this_target} "-lchromium" ) TARGET_LINK_LIBRARIES(${this_target} "-lpthread" ) TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw -losp-net" ) TARGET_LINK_LIBRARIES(${this_target} "-lcapi-network-bluetooth" ) 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") INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/inc/ DESTINATION include/osp/net FILES_MATCHING PATTERN "*.h") SET(PC_NAME ${this_target}) SET(VERSION ${FULLVER}) SET(PC_LDFLAGS -l${this_target}) # 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)