diff options
author | louiz’ <louiz@louiz.org> | 2017-05-10 16:48:51 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-05-10 16:50:11 +0200 |
commit | da55060840631bb63978a67270066b009b9c9270 (patch) | |
tree | 92e5b013c4f7377fb75d9805841fcb54ec2f55db | |
parent | 7a08196d09536dbfd2dd4ae82b09c61b028fc8a9 (diff) | |
download | biboumi-da55060840631bb63978a67270066b009b9c9270.tar.gz biboumi-da55060840631bb63978a67270066b009b9c9270.tar.bz2 biboumi-da55060840631bb63978a67270066b009b9c9270.tar.xz biboumi-da55060840631bb63978a67270066b009b9c9270.zip |
Improve the handling of the biboudb.hpp dependencies
-rw-r--r-- | CMakeLists.txt | 15 | ||||
-rw-r--r-- | cmake/Modules/FindLITESQL.cmake | 2 | ||||
-rw-r--r-- | src/network/credentials_manager.cpp | 4 |
3 files changed, 9 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f2ab189..8e7d09a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,17 +153,17 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/") file(GLOB source_utils src/utils/*.[hc]pp) add_library(utils OBJECT ${source_utils}) -add_dependencies(utils database) +add_dependencies(utils litesql_generated_sources) file(GLOB source_irc src/irc/*.[hc]pp) add_library(irc OBJECT ${source_irc}) -add_dependencies(irc database) +add_dependencies(irc litesql_generated_sources) file(GLOB source_xmpp src/xmpp/*.[hc]pp) add_library(xmpp OBJECT ${source_xmpp}) -add_dependencies(xmpp database) +add_dependencies(xmpp litesql_generated_sources) file(GLOB source_identd src/identd/*.[hc]pp) @@ -172,7 +172,7 @@ add_library(identd OBJECT ${source_identd}) file(GLOB source_bridge src/bridge/*.[hc]pp) add_library(bridge OBJECT ${source_bridge}) -add_dependencies(bridge database) +add_dependencies(bridge litesql_generated_sources) file(GLOB source_config src/config/*.[hc]pp) @@ -185,15 +185,16 @@ add_library(logger OBJECT ${source_logger}) file(GLOB source_network src/network/*.[hc]pp) add_library(network OBJECT ${source_network}) -add_dependencies(network database) if(LITESQL_FOUND) LITESQL_GENERATE_CPP("database/database.xml" "biboudb" LITESQL_GENERATED_SOURCES) + add_custom_target(litesql_generated_sources SOURCES ${LITESQL_GENERATED_SOURCES}) + + add_library(database OBJECT src/database/database.cpp ${LITESQL_GENERATED_SOURCES}) + add_dependencies(database litesql_generated_sources) - add_library(database OBJECT src/database/database.cpp - ${LITESQL_GENERATED_SOURCES}) include_directories(database ${LITESQL_INCLUDE_DIRS}) set(USE_DATABASE TRUE) else() diff --git a/cmake/Modules/FindLITESQL.cmake b/cmake/Modules/FindLITESQL.cmake index 18f0bfa..2d3b073 100644 --- a/cmake/Modules/FindLITESQL.cmake +++ b/cmake/Modules/FindLITESQL.cmake @@ -65,7 +65,7 @@ function(LITESQL_GENERATE_CPP add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}.cpp" "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}.hpp" - COMMAND ${LITESQLGEN_EXECUTABLE} + COMMAND ${LITESQLGEN_EXECUTABLE} ARGS -t c++ --output-dir=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE} DEPENDS ${SOURCE_FILE} COMMENT "Running litesql-gen on ${SOURCE_FILE}" diff --git a/src/network/credentials_manager.cpp b/src/network/credentials_manager.cpp index ea76627..f93a366 100644 --- a/src/network/credentials_manager.cpp +++ b/src/network/credentials_manager.cpp @@ -7,10 +7,6 @@ #include <botan/tls_exceptn.h> #include <config/config.hpp> -#ifdef USE_DATABASE -# include <database/database.hpp> -#endif - /** * TODO find a standard way to find that out. */ |