From f7595acb30071eb5001b629f47f5606ea07e2a5a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 11 May 2011 19:11:05 +0400 Subject: [PATCH] Fix dependencies in cmake. --- CMakeLists.txt | 9 +++++---- lib/CMakeLists.txt | 7 ++++++- utils/statshow/CMakeLists.txt | 1 - 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bbe628dd5..cbddacb6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -563,6 +563,10 @@ SET(PLUGINSSRC src/plugins/surbl.c src/plugins/fuzzy_check.c src/plugins/spf.c) +ADD_CUSTOM_COMMAND(OUTPUT src/modules.c + COMMAND ../utils/gen-modules.sh ${PLUGINSSRC} + WORKING_DIRECTORY src) + ADD_SUBDIRECTORY(src/lua) ADD_SUBDIRECTORY(src/json) ADD_SUBDIRECTORY(src/cdb) @@ -578,9 +582,7 @@ LIST(LENGTH PLUGINSSRC RSPAMD_MODULES_NUM) ############################ TARGETS SECTION ############################### -ADD_CUSTOM_COMMAND(OUTPUT src/modules.c - COMMAND ../utils/gen-modules.sh ${PLUGINSSRC} - WORKING_DIRECTORY src) + CONFIGURE_FILE(config.h.in src/config.h) CONFIGURE_FILE(contrib/exim/local_scan.c.in contrib/exim/local_scan_rspamd.c @ONLY) @@ -588,7 +590,6 @@ CONFIGURE_FILE(rspamd.xml.sample conf/rspamd.xml.sample @ONLY) ######################### LINK SECTION ############################### - ADD_EXECUTABLE(rspamd ${RSPAMDSRC} ${CONTRIBSRC} ${TOKENIZERSSRC} ${CLASSIFIERSSRC} ${PLUGINSSRC}) SET_TARGET_PROPERTIES(rspamd PROPERTIES LINKER_LANGUAGE C) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 951551e62..2fdf37904 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -64,4 +64,9 @@ SET_TARGET_PROPERTIES(rspamdserver PROPERTIES LINKER_LANGUAGE C) SET_TARGET_PROPERTIES(rspamdserver PROPERTIES COMPILE_FLAGS "-DRSPAMD_LIB") TARGET_LINK_LIBRARIES(rspamdserver rspamd_lua) TARGET_LINK_LIBRARIES(rspamdserver rspamd_json) -TARGET_LINK_LIBRARIES(rspamdserver rspamd_cdb) \ No newline at end of file +TARGET_LINK_LIBRARIES(rspamdserver rspamd_cdb) + +ADD_CUSTOM_TARGET(genmodules + COMMAND ../utils/gen-modules.sh ${PLUGINSSRC} + WORKING_DIRECTORY src) +ADD_DEPENDENCIES(rspamdserver genmodules) \ No newline at end of file diff --git a/utils/statshow/CMakeLists.txt b/utils/statshow/CMakeLists.txt index 2e28d019e..bf3308814 100644 --- a/utils/statshow/CMakeLists.txt +++ b/utils/statshow/CMakeLists.txt @@ -2,7 +2,6 @@ SET(STATSHOWSRC statshow.c) FOREACH(_rs ${CLASSIFIERSSRC} ${TOKENIZERSSRC}) LIST(APPEND STATSHOWSRC "../../${_rs}") - MESSAGE("${_rs}") ENDFOREACH(_rs) ADD_EXECUTABLE(statshow EXCLUDE_FROM_ALL ${STATSHOWSRC}) -- 2.39.5