summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-01-20 12:54:45 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-01-22 15:58:05 +0000
commit19ec44180cef856f21d39db54364d162c972dc05 (patch)
treecf5039c0888a16b74e2b5b02e2d61528320c34d0
parent6ce835fc7af4e6b58b4eea9da9587a7fd75a2ddc (diff)
downloadrspamd-19ec44180cef856f21d39db54364d162c972dc05.tar.gz
rspamd-19ec44180cef856f21d39db54364d162c972dc05.zip
[Minor] Improve ragel support in cmake
-rw-r--r--cmake/FindRagel.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmake/FindRagel.cmake b/cmake/FindRagel.cmake
index f17766ac6..d02a00bea 100644
--- a/cmake/FindRagel.cmake
+++ b/cmake/FindRagel.cmake
@@ -73,7 +73,7 @@ ${RAGEL_version_error}")
CMAKE_PARSE_ARGUMENTS(RAGEL "" "OUTPUT"
"INPUTS;DEPENDS;COMPILE_FLAGS" ${ARGN})
- file(RELATIVE_PATH RAGEL_OUTPUT_RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
+ file(RELATIVE_PATH RAGEL_OUTPUT_RELATIVE "${CMAKE_CURRENT_BINARY_DIR}"
"${RAGEL_OUTPUT}")
file(RELATIVE_PATH RAGEL_INPUTS_RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"${RAGEL_INPUTS}")
@@ -84,8 +84,11 @@ ${RAGEL_version_error}")
-o${RAGEL_OUTPUT_RELATIVE} ${RAGEL_INPUTS_RELATIVE}
DEPENDS ${RAGEL_INPUTS} ${RAGEL_DEPENDS}
COMMENT
- "[RAGEL][${Name}] Compiling state machine with Ragel ${RAGEL_VERSION}"
+ "[RAGEL][${Name}] Compiling state machine with Ragel ${RAGEL_VERSION} -> ${RAGEL_OUTPUT}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ get_filename_component(src_target ${RAGEL_INPUTS} NAME_WE)
+ add_custom_target(ragel_${src_target} DEPENDS ${RAGEL_OUTPUT})
+ set_source_files_properties(${RAGEL_OUTPUT} PROPERTIES GENERATED TRUE)
set(RAGEL_${Name}_DEFINED TRUE)
set(RAGEL_${Name}_OUTPUTS ${RAGEL_OUTPUT})