Handle msg storage option when building with CMake.

This commit is contained in:
Ghislain MARY 2014-12-04 16:25:36 +01:00
parent 570ed0f598
commit 381744b0f4
2 changed files with 13 additions and 0 deletions

View file

@ -86,6 +86,12 @@ if(ENABLE_TUNNEL)
set(ENABLE_TUNNEL OFF CACHE BOOL "Enable tunnel support." FORCE)
endif()
endif()
if(ENABLE_MSG_STORAGE)
find_package(Sqlite3)
if(NOT SQLITE3_FOUND)
message(FATAL_ERROR "Could not find the sqlite3 library!")
endif()
endif()
if(ENABLE_NOTIFY)
find_package(Notify)
if(NOTIFY_FOUND)
@ -107,6 +113,10 @@ include_directories(
${MS2_INCLUDE_DIRS}
${XML2_INCLUDE_DIRS}
)
if(SQLITE3_FOUND)
include_directories(${SQLITE3_INCLUDE_DIRS})
add_definitions("-DMSG_STORAGE_ENABLED")
endif()
if(ENABLE_TUNNEL)
include_directories(${TUNNEL_INCLUDE_DIRS})
endif()

View file

@ -117,6 +117,9 @@ set(LIBS
${MS2_LIBRARIES}
${XML2_LIBRARIES}
)
if(SQLITE3_FOUND)
list(APPEND LIBS ${SQLITE3_LIBRARIES})
endif()
if(ENABLE_TUNNEL)
list(APPEND LIBS ${TUNNEL_LIBRARIES})
endif()