e64d8bf6590252263bce0f471f215fd0b374fdef
[framework/web/wrt-plugins-tizen.git] / src / Bluetooth / CMakeLists.txt
1 SET(TARGET_NAME ${bluetooth_target})
2 SET(DESTINATION_NAME ${bluetooth_dest})
3 SET(TARGET_IMPL_NAME ${bluetooth_impl})
4
5 IF(ENABLE_OPTIONAL_BT)
6 PKG_SEARCH_MODULE(bluetooth REQUIRED capi-network-bluetooth)
7 PKG_SEARCH_MODULE(system-info REQUIRED capi-system-info)
8
9 SET(CMAKE_INSTALL_RPATH
10         ${CMAKE_INSTALL_RPATH}
11         ${CMAKE_INSTALL_PREFIX}/${DESTINATION_LIB_PREFIX}/${DESTINATION_NAME}
12 )
13
14 SET(SRCS_IMPL
15     JSBluetoothManager.cpp
16     JSBluetoothAdapter.cpp
17     JSBluetoothDevice.cpp
18     JSBluetoothSocket.cpp
19     JSBluetoothClass.cpp
20     JSBluetoothClassDeviceMajor.cpp
21     JSBluetoothClassDeviceMinor.cpp
22     JSBluetoothClassDeviceService.cpp
23     JSBluetoothServiceHandler.cpp
24     BluetoothAdapter.cpp
25     BluetoothDevice.cpp
26     BluetoothSocket.cpp
27     BluetoothClass.cpp
28     BluetoothClassDeviceMajor.cpp
29     BluetoothClassDeviceMinor.cpp
30     BluetoothClassDeviceService.cpp
31     BluetoothServiceHandler.cpp
32     BluetoothCallbackUtil.cpp
33 )
34 #   BluetoothManager.cpp
35
36 INCLUDE_DIRECTORIES(
37         ${INCLUDE_COMMON}
38         ${bluetooth_INCLUDE_DIRS}
39         ${system-info_INCLUDE_DIRS}
40 )
41
42 ADD_LIBRARY(${TARGET_IMPL_NAME} SHARED ${SRCS_IMPL})
43
44 TARGET_LINK_LIBRARIES(${TARGET_IMPL_NAME}
45         ${LIBS_COMMON}
46         ${bluetooth_LIBRARIES}
47         ${system-info_LIBRARIES}
48 )
49
50 SET(SRCS
51         plugin_config.cpp
52         plugin_initializer.cpp
53 )
54
55 ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
56
57 TARGET_LINK_LIBRARIES(${TARGET_NAME}
58         ${TARGET_IMPL_NAME}
59 )
60
61 INSTALL(TARGETS ${TARGET_NAME} ${TARGET_IMPL_NAME} LIBRARY DESTINATION ${DESTINATION_LIB_PREFIX}/${DESTINATION_NAME})
62 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/config.xml DESTINATION ${DESTINATION_LIB_PREFIX}/${DESTINATION_NAME})
63 ENDIF(ENABLE_OPTIONAL_BT)
64 INSTALL(
65         DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${DESTINATION_HEADER_PREFIX}/bluetooth
66         FILES_MATCHING PATTERN "*.h" PATTERN "CMakeFiles" EXCLUDE
67 )