From 28aa3884766bb09485428ce0c91104f7129b8145 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 21 Mar 2014 04:54:33 +0100 Subject: [PATCH] Require libsqlite3 --- CMakeLists.txt | 5 +++++ mmss/CMakeLists.txt | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6509ceb..662913a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,11 @@ project(GMRF C CXX) set(CMAKE_MODULE_PATH ${GMRF_SOURCE_DIR}) find_package(BISON 2.5 REQUIRED) +find_package(PkgConfig REQUIRED) + + +pkg_check_modules(SQLITE REQUIRED sqlite3) + add_subdirectory(mmss) add_subdirectory(mmss-protocol) diff --git a/mmss/CMakeLists.txt b/mmss/CMakeLists.txt index 4823bce..470ae00 100644 --- a/mmss/CMakeLists.txt +++ b/mmss/CMakeLists.txt @@ -1,4 +1,5 @@ include_directories(${GMRF_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) +link_directories(${SQLITE_LIBRARY_DIRS}) set_directory_properties(PROPERTIES COMPILE_DEFINITIONS _GNU_SOURCE) BISON_TARGET(mmss_config_parse config.y ${CMAKE_CURRENT_BINARY_DIR}/config.yy.cpp) @@ -18,4 +19,7 @@ add_executable(mmss ${BISON_mmss_config_parse_OUTPUTS} ) target_link_libraries(mmss dl) -set_target_properties(mmss PROPERTIES COMPILE_FLAGS "-std=c++11 -Wall") +set_property(TARGET mmss PROPERTY COMPILE_FLAGS "-std=c++11 ${SQLITE_CFLAGS_OTHER} -Wall") +set_property(TARGET mmss PROPERTY LINK_FLAGS "${SQLITE_LDFLAGS_OTHER}") +set_property(TARGET mmss APPEND PROPERTY INCLUDE_DIRECTORIES ${SQLITE_INCLUDE_DIRS}) +target_link_libraries(mmss ${SQLITE_LIBRARIES})