Commit da550608 authored by louiz’'s avatar louiz’

Improve the handling of the biboudb.hpp dependencies

parent 7a08196d
......@@ -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()
......
......@@ -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}"
......
......@@ -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.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment