3 add_definitions(-Dwebsocket_plugin)
5 include(CheckIncludeFiles)
6 include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs})
8 find_package(Qt5Core REQUIRED)
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)
19 pkg_check_modules(websockets REQUIRED libwebsockets)
21 include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs} ${QT_INCLUDE_DIRS})
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})
29 install(TARGETS websocketsink LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
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})
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)
43 install(TARGETS websocketsource LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
45 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_BINARY_DIR}/websocket.README @ONLY)
47 install (FILES ${CMAKE_CURRENT_BINARY_DIR}/websocket.README DESTINATION ${DOC_INSTALL_DIR}/plugins)
49 endif(websocket_plugin)