summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Leske <sebastian.leske@sleske.name>2017-06-17 18:47:04 +0200
committerSebastian Leske <sebastian.leske@sleske.name>2017-06-17 18:47:51 +0200
commitc5b38873eb9396f2bd834166e828145311d7740a (patch)
tree36239015ca2d5778d2f14f9d4f283165d97d6564
parent07db3e37c7b44b3ff4e2d58d46611a546e146912 (diff)
downloadnavit-c5b38873eb9396f2bd834166e828145311d7740a.tar.gz
Fix:build:Regenerate navit*.xml if XSLT files change. Fixes first part of #1333.
-rw-r--r--navit/CMakeLists.txt7
-rw-r--r--navit/xslt/README-new-files.txt3
2 files changed, 9 insertions, 1 deletions
diff --git a/navit/CMakeLists.txt b/navit/CMakeLists.txt
index c9d56cd34..c860f123c 100644
--- a/navit/CMakeLists.txt
+++ b/navit/CMakeLists.txt
@@ -132,9 +132,14 @@ macro(process_xslt SRC_XML DEST_XML)
list(APPEND XSLT_COMMANDS COMMAND ${CMAKE_COMMAND} -E rename ${DEST_XML}.tmp ${DEST_XML})
endforeach()
endif()
+ # Depend on all XSLT files, because the main XSLT file may pull in other files.
+ # Ideally we'd parse the main XSLT file for includes, but that is tricky to do reliably.
+ # Note that this list of files is only updated when (re)running CMake, so if files are
+ # added/deleted, CMake must be re-run manually.
+ file(GLOB ALL_XSLT_FILES "${PROJECT_SOURCE_DIR}/navit/xslt/*.xslt")
ADD_CUSTOM_COMMAND(
OUTPUT ${DEST_XML}
- DEPENDS ${SRC_XML} ${XSLT_FILES}
+ DEPENDS ${SRC_XML} ${ALL_XSLT_FILES}
${XSLT_COMMANDS}
)
endmacro()
diff --git a/navit/xslt/README-new-files.txt b/navit/xslt/README-new-files.txt
new file mode 100644
index 000000000..4997ac1c4
--- /dev/null
+++ b/navit/xslt/README-new-files.txt
@@ -0,0 +1,3 @@
+If you add new XSLT files to this directory (or delete existing files),
+you need to re-run cmake, otherwise changes to these files will not be
+picked up by cmake.