From da55060840631bb63978a67270066b009b9c9270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Wed, 10 May 2017 16:48:51 +0200 Subject: Improve the handling of the biboudb.hpp dependencies --- CMakeLists.txt | 15 ++++++++------- cmake/Modules/FindLITESQL.cmake | 2 +- 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 #include -#ifdef USE_DATABASE -# include -#endif - /** * TODO find a standard way to find that out. */ -- cgit v1.2.3