aboutsummaryrefslogtreecommitdiff
path: root/apps/CMakeLists.txt
diff options
context:
space:
mode:
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)