diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 93e91ba..1bad544 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,8 +44,11 @@ set(SOFTWARE_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}${${PROJECT_NAME}_VERSION_SUFFIX}) # To be able to include the config.h file generated by cmake + +# To be able to include the config.h and other files generated by cmake include_directories("${CMAKE_CURRENT_BINARY_DIR}/src/") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/") +include_directories("${CMAKE_CURRENT_BINARY_DIR}/") # ## Documentation @@ -63,6 +66,24 @@ if(RONN_EXECUTABLE) add_custom_target(doc DEPENDS ${MAN_PAGE}) endif() +# Look for litesql and enable the database if found +if(WITH_LITESQL) + find_package(LITESQL REQUIRED) +elseif(NOT WITHOUT_LITESQL) + find_package(LITESQL) +endif() + +if(LITESQL_FOUND) + LITESQL_GENERATE_CPP("database/database.xml" + "biboudb" + LITESQL_GENERATED_SOURCES) + + add_library(database STATIC src/database/database.cpp + ${LITESQL_GENERATED_SOURCES}) + target_link_libraries(database ${LITESQL_LIBRARIES} ${BOTAN_LIBRARIES}) + set(USE_DATABASE TRUE) +endif() + add_subdirectory("louloulibs") include_directories("louloulibs") @@ -97,6 +118,9 @@ file(GLOB source_xmpp add_library(xmpp STATIC ${source_xmpp}) target_link_libraries(xmpp xmpplib bridge network utils logger) +if(USE_DATABASE) + target_link_libraries(xmpp database) +endif() # ## bridge # @@ -134,6 +158,11 @@ target_link_libraries(test_suite config logger) +if(USE_DATABASE) + target_link_libraries(test_suite + database) +endif() + # ## Install target # @@ -151,3 +180,5 @@ add_custom_target(dist COMMAND git archive --prefix=${ARCHIVE_NAME}/ --format=tar HEAD | xz > ${CMAKE_CURRENT_BINARY_DIR}/${ARCHIVE_NAME}.tar.xz WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/biboumi.h.cmake ${CMAKE_BINARY_DIR}/src/biboumi.h)
\ No newline at end of file |