aboutsummaryrefslogtreecommitdiff
path: root/apps/CMakeLists.txt
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-02-23 23:04:38 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-02-23 23:04:38 +0100
commit4671571c93db7f083db21cfca526ac382cdfc7ad (patch)
tree834d24e1e59ab9ace06d15fd9abf149470ca20e3 /apps/CMakeLists.txt
parentd0fb1850606ce003887259675e271a9aade4fda0 (diff)
downloadble-toys-4671571c93db7f083db21cfca526ac382cdfc7ad.tar.gz
ble-toys-4671571c93db7f083db21cfca526ac382cdfc7ad.tar.bz2
ble-toys-4671571c93db7f083db21cfca526ac382cdfc7ad.tar.xz
ble-toys-4671571c93db7f083db21cfca526ac382cdfc7ad.zip
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.
Diffstat (limited to 'apps/CMakeLists.txt')
-rw-r--r--apps/CMakeLists.txt16
1 files changed, 15 insertions, 1 deletions
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)