From 107e07ea5ba9da5817c2a53159ef5c50039963f4 Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Thu, 11 Apr 2013 06:34:27 -0700 Subject: [PATCH] disable websockets by default --- CMakeLists.txt | 23 ++++++++++++++++++++++- TODO | 2 ++ docs/drivingsafety.txt | 3 +-- plugins/websocketsink/CMakeLists.txt | 4 ++++ plugins/websocketsink/websocketsinkmanager.cpp | 1 - plugins/websocketsourceplugin/CMakeLists.txt | 8 ++++++-- 6 files changed, 35 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8cfb88..010055b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,9 @@ set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The direc set (DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}" CACHE PATH "The directory the docs will be installed to") option(use_qtcore "Use QCoreApplication mainloop " OFF) +option(websocket_plugin "websocket source and sink plugins" OFF) option(tpms_plugin "TPMS plugin " OFF) -option(obd2_plugin "OBD-II plugin" ON) +option(obd2_plugin "OBD-II plugin" OFF) option(database_plugin "Database plugins" OFF) option(qt_bindings "AMB Qt DBus bindings" OFF) option(opencvlux_plugin "OpenCV Lux plugin" OFF) @@ -85,6 +86,26 @@ add_custom_target(dist COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD | bzip configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") +# packaging stuff: +# Common things to every type of package +SET(CPACK_PACKAGE_DESCRIPTION "daemon to access vehicle data") +SET(CPACK_PACKAGE_NAME "automotive-message-broker") +SET(CPACK_PACKAGE_EXECUTABLES "ambd") +SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") +SET(CPACK_STRIP_FILES true) +SET(CPACK_PACKAGE_CONTACT "tripzero.kev@gmail.com") +SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") + + +# Always build .tar.gz and .sh files +SET(CPACK_GENERATOR "STGZ;TGZ") + +SET(CPACK_GENERATOR "${CPACK_GENERATOR};DEB") +SET(CPACK_DEBIAN_PACKAGE_DEPENDS "gpsd (>=2.0), libopencv, libjson0, libltdl7") +SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) + +INCLUDE(CPack) + add_subdirectory(lib) add_subdirectory(ambd) add_subdirectory(plugins) diff --git a/TODO b/TODO index 8cffde2..3cde675 100644 --- a/TODO +++ b/TODO @@ -12,3 +12,5 @@ Other: - DBus support for objects with multiple sources (ie battery(n)Voltage where 'n' is a battery source) - Clean up sink subscription process so that subscription only happens once regardless of whether the property is supported or not at the time +- enable ambd/config.d/ + diff --git a/docs/drivingsafety.txt b/docs/drivingsafety.txt index 1f486e8..7356729 100644 --- a/docs/drivingsafety.txt +++ b/docs/drivingsafety.txt @@ -43,7 +43,6 @@ Properties: Driver = 0, Passenger = 1, LeftSide = 2, - RightSide = 3 Status: @@ -164,7 +163,7 @@ Properties: LeftRear = 2, RightRear = 3, LeftBlindSpot = 4, - RightBlindSPot = 5 + RightBlindSpot = 5 diff --git a/plugins/websocketsink/CMakeLists.txt b/plugins/websocketsink/CMakeLists.txt index c2e26a0..242932f 100644 --- a/plugins/websocketsink/CMakeLists.txt +++ b/plugins/websocketsink/CMakeLists.txt @@ -1,3 +1,5 @@ +if(websocket_plugin) + include(CheckIncludeFiles) include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs}) @@ -10,3 +12,5 @@ set_target_properties(websocketsinkplugin PROPERTIES PREFIX "") target_link_libraries(websocketsinkplugin amb ${websockets_LIBRARIES} -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries}) install(TARGETS websocketsinkplugin LIBRARY DESTINATION lib/automotive-message-broker) + +endif(websocket_plugin) diff --git a/plugins/websocketsink/websocketsinkmanager.cpp b/plugins/websocketsink/websocketsinkmanager.cpp index 8b13dd5..1146ae0 100644 --- a/plugins/websocketsink/websocketsinkmanager.cpp +++ b/plugins/websocketsink/websocketsinkmanager.cpp @@ -20,7 +20,6 @@ #include "websocketsinkmanager.h" #include "websocketsink.h" #include -//#include #include #include #include diff --git a/plugins/websocketsourceplugin/CMakeLists.txt b/plugins/websocketsourceplugin/CMakeLists.txt index aaf1de5..2bf6345 100644 --- a/plugins/websocketsourceplugin/CMakeLists.txt +++ b/plugins/websocketsourceplugin/CMakeLists.txt @@ -1,12 +1,16 @@ +if(websocket_plugin) + include(CheckIncludeFiles) include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs}) -check_include_files(libwebsockets.h HAVE_WEBSOCKETS) +pkg_check_modules(websockets REQUIRED libwebsockets) set(websocketsourceplugin_headers websocketsource.h) set(websocketsourceplugin_sources websocketsource.cpp) add_library(websocketsourceplugin MODULE ${websocketsourceplugin_sources}) set_target_properties(websocketsourceplugin PROPERTIES PREFIX "") -target_link_libraries(websocketsourceplugin amb websockets -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries}) +target_link_libraries(websocketsourceplugin amb ${websockets_LIBRARIES} -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries}) install(TARGETS websocketsourceplugin LIBRARY DESTINATION lib/automotive-message-broker) + +endif(websocket_plugin) -- 2.7.4