aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/FindRagel.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmake/FindRagel.cmake b/cmake/FindRagel.cmake
index a058b7fb1..f17766ac6 100644
--- a/cmake/FindRagel.cmake
+++ b/cmake/FindRagel.cmake
@@ -72,9 +72,16 @@ ${RAGEL_version_error}")
macro(RAGEL_TARGET Name)
CMAKE_PARSE_ARGUMENTS(RAGEL "" "OUTPUT"
"INPUTS;DEPENDS;COMPILE_FLAGS" ${ARGN})
+
+ file(RELATIVE_PATH RAGEL_OUTPUT_RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
+ "${RAGEL_OUTPUT}")
+ file(RELATIVE_PATH RAGEL_INPUTS_RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
+ "${RAGEL_INPUTS}")
+
add_custom_command(OUTPUT ${RAGEL_OUTPUT}
COMMAND ${RAGEL_EXECUTABLE}
- ARGS ${RAGEL_COMPILE_FLAGS} -o${RAGEL_OUTPUT} ${RAGEL_INPUTS}
+ ARGS ${RAGEL_COMPILE_FLAGS}
+ -o${RAGEL_OUTPUT_RELATIVE} ${RAGEL_INPUTS_RELATIVE}
DEPENDS ${RAGEL_INPUTS} ${RAGEL_DEPENDS}
COMMENT
"[RAGEL][${Name}] Compiling state machine with Ragel ${RAGEL_VERSION}"
@@ -93,4 +100,4 @@ endif()
# use this include when module file is located in build tree
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(RAGEL REQUIRED_VARS RAGEL_EXECUTABLE
- VERSION_VAR RAGEL_VERSION) \ No newline at end of file
+ VERSION_VAR RAGEL_VERSION)