From 4671571c93db7f083db21cfca526ac382cdfc7ad Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 23 Feb 2015 23:04:38 +0100 Subject: Major improvement in the sm-get-value utility: o Adding command line option parsing through boost::program_option Current options: --device, --sensor --format selects between CSV and JSON output. --sleep controls single reads vs continuous reads. o Adding JSON output. o Adding support for Release builds without debugging info. Needs improvement. --- apps/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'apps/CMakeLists.txt') diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index e210716..9d68f79 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -2,7 +2,7 @@ set(APPS sm-get-value ble-inspect-device) set(shared_sources SoilMoisture.cpp) # Boost -find_package(Boost COMPONENTS system log thread REQUIRED) +find_package(Boost COMPONENTS system log thread program_options REQUIRED) # Bluez pkg_check_modules(BLUEZ bluez REQUIRED) @@ -10,8 +10,21 @@ pkg_check_modules(BLUEZ bluez REQUIRED) # pthreads find_package(Threads REQUIRED) +pkg_check_modules(PQXX libpqxx REQUIRED) + +include(ExternalProject) +ExternalProject_Add( + JSON + PREFIX json + GIT_REPOSITORY https://github.com/nlohmann/json.git + GIT_TAG ec42245951fceb7594bfb24746c7449986c3c2a4 + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "") + foreach(app ${APPS}) include_directories("${PROJECT_SOURCE_DIR}/include") + include_directories("${CMAKE_BINARY_DIR}/apps/json/src/JSON/src") add_executable(${app} ${app}.cpp ${shared_sources}) add_dependencies(${app} ble) @@ -19,5 +32,6 @@ foreach(app ${APPS}) target_link_libraries(${app} ble) target_link_libraries(${app} ${Boost_LIBRARIES}) target_link_libraries(${app} ${BLUEZ_LIBRARIES}) + target_link_libraries(${app} ${PQXX_LIBRARIES}) target_link_libraries(${app} ${CMAKE_THREAD_LIBS_INIT}) endforeach(app) -- cgit v1.2.3