[websocket] fixed getRanged requests
[profile/ivi/automotive-message-broker.git] / plugins / websocket / CMakeLists.txt
1 if(websocket_plugin)
2
3 add_definitions(-Dwebsocket_plugin)
4
5 include(CheckIncludeFiles)
6 include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs})
7
8 find_package(Qt5Core REQUIRED)
9
10 if(Qt5Core_FOUND)
11   set(QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} )
12   set(QT_LIBRARIES ${Qt5Core_LIBRARIES} )
13   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
14   add_definitions(${Qt5Core_DEFINITIONS} -DQTBINARY_DATA)
15   add_definitions(-DQT_NO_KEYWORDS)
16   set(CMAKE_AUTOMOC ON)
17 endif(Qt5Core_FOUND)
18
19 pkg_check_modules(websockets REQUIRED libwebsockets)
20
21 include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs} ${QT_INCLUDE_DIRS})
22
23 set(websocketsink_headers websocketsink.h websocketmanager.h common.h)
24 set(websocketsink_sources websocketsinkmanager.cpp websocketsink.cpp common.cpp)
25 add_library(websocketsink MODULE ${websocketsink_sources})
26 set_target_properties(websocketsink PROPERTIES PREFIX "")
27 target_link_libraries(websocketsink amb ${websockets_LIBRARIES} -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries} ${QT_LIBRARIES})
28
29 install(TARGETS websocketsink LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
30
31
32 set(websocketsource_headers websocketsource.h common.h)
33 set(websocketsource_sources websocketsource.cpp common.cpp)
34 add_library(websocketsource MODULE ${websocketsource_sources})
35 set_target_properties(websocketsource PROPERTIES PREFIX "")
36 target_link_libraries(websocketsource amb ${websockets_LIBRARIES} -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries} ${QT_LIBRARIES})
37
38 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/vehicle.js ${CMAKE_CURRENT_SOURCE_DIR}/test/vehicle.js)
39 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/test.js ${CMAKE_CURRENT_SOURCE_DIR}/test/test.js)
40 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/events.js ${CMAKE_CURRENT_SOURCE_DIR}/test/events.js)
41 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protocol ${CMAKE_CURRENT_SOURCE_DIR}/protocol)
42
43 install(TARGETS websocketsource LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
44
45 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_BINARY_DIR}/websocket.README @ONLY)
46
47 install (FILES ${CMAKE_CURRENT_BINARY_DIR}/websocket.README DESTINATION ${DOC_INSTALL_DIR}/plugins)
48
49 endif(websocket_plugin)