diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-01 21:15:01 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-01 21:15:01 +0100 |
commit | e64d925b45ff4802fe924ea2e8108bb1932b4d01 (patch) | |
tree | 3f9b524c9526834b5830030562e9cb581235f2d6 /apps/CMakeLists.txt | |
parent | 1b09c7d0547fb430e957b863bdbb3bf54c85f52a (diff) | |
download | ble-toys-e64d925b45ff4802fe924ea2e8108bb1932b4d01.tar.gz ble-toys-e64d925b45ff4802fe924ea2e8108bb1932b4d01.tar.bz2 ble-toys-e64d925b45ff4802fe924ea2e8108bb1932b4d01.tar.xz ble-toys-e64d925b45ff4802fe924ea2e8108bb1932b4d01.zip |
o Replacing boost::logging with log4cplus.
Diffstat (limited to 'apps/CMakeLists.txt')
-rw-r--r-- | apps/CMakeLists.txt | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 792e339..ab9c529 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -3,10 +3,15 @@ set(APPS sm-db-insert sm-db-select sm-get-value) -set(shared_sources SoilMoisture.cpp) + +set(APPS ${APPS} log4cplus-test) + +set(shared_sources + SoilMoisture.cpp + apps.cpp) # Boost -find_package(Boost COMPONENTS system log thread program_options REQUIRED) +find_package(Boost COMPONENTS system program_options REQUIRED) # Bluez pkg_check_modules(BLUEZ bluez REQUIRED) @@ -16,6 +21,16 @@ find_package(Threads REQUIRED) pkg_check_modules(PQXX libpqxx REQUIRED) +find_path(LOG4CPLUS_INCLUDE_DIRECTORIES log4cplus/logger.h) +if(LOG4CPLUS_INCLUDE_DIRECTORIES MATCHES NOTFOUND) + message(FATAL_ERROR "Could not find log4cplus header files") +endif() + +find_library(LOG4CPLUS_LIBRARIES log4cplus) +if(LOG4CPLUS_LIBRARIES MATCHES NOTFOUND) + message(FATAL_ERROR "Could not find log4cplus library files") +endif() + include(ExternalProject) ExternalProject_Add( JSON @@ -37,5 +52,7 @@ foreach(app ${APPS}) target_link_libraries(${app} ${Boost_LIBRARIES}) target_link_libraries(${app} ${BLUEZ_LIBRARIES}) target_link_libraries(${app} ${PQXX_LIBRARIES}) + include_directories("${LOG4CPLUS_INCLUDE_DIRECTORIES}") + target_link_libraries(${app} ${LOG4CPLUS_LIBRARIES}) target_link_libraries(${app} ${CMAKE_THREAD_LIBS_INIT}) endforeach(app) |