disable websockets by default
authorKevron Rees <tripzero.kev@gmail.com>
Thu, 11 Apr 2013 13:34:27 +0000 (06:34 -0700)
committerKevron Rees <tripzero.kev@gmail.com>
Thu, 11 Apr 2013 13:34:27 +0000 (06:34 -0700)
CMakeLists.txt
TODO
docs/drivingsafety.txt
plugins/websocketsink/CMakeLists.txt
plugins/websocketsink/websocketsinkmanager.cpp
plugins/websocketsourceplugin/CMakeLists.txt

index d8cfb88..010055b 100644 (file)
@@ -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 (file)
--- 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/
+
index 1f486e8..7356729 100644 (file)
@@ -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
                                
 
                                
index c2e26a0..242932f 100644 (file)
@@ -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)
index 8b13dd5..1146ae0 100644 (file)
@@ -20,7 +20,6 @@
 #include "websocketsinkmanager.h"
 #include "websocketsink.h"
 #include <sstream>
-//#include <json-glib/json-glib.h>
 #include <json/json.h>
 #include <json/json_object.h>
 #include <json/json_tokener.h>
index aaf1de5..2bf6345 100644 (file)
@@ -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)