~singpolyma/biboumi

da55060840631bb63978a67270066b009b9c9270 — louiz’ 5 years ago 7a08196
Improve the handling of the biboudb.hpp dependencies
3 files changed, 9 insertions(+), 12 deletions(-)

M CMakeLists.txt
M cmake/Modules/FindLITESQL.cmake
M src/network/credentials_manager.cpp
M CMakeLists.txt => CMakeLists.txt +8 -7
@@ 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()

M cmake/Modules/FindLITESQL.cmake => cmake/Modules/FindLITESQL.cmake +1 -1
@@ 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}"

M src/network/credentials_manager.cpp => src/network/credentials_manager.cpp +0 -4
@@ 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.
 */