summaryrefslogtreecommitdiff
path: root/CMake/vendor_substitute.cmake
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-07 03:34:18 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-10 16:10:51 +0200
commit7d33e7c79cd6c3f0f053d13532ca73ce3bf7c5ce (patch)
tree6ec67f499d484bb535beacb74ad181e624cf146c /CMake/vendor_substitute.cmake
parent0fead28404498f42324dd86b4246d35af8905ed3 (diff)
CMake: Improve handling of vendor files
First of all, instead of creating the files at configure time, generate the files using normal target. This has the huge advantage that they are rebuilt if their input changes. While we are at it, also add dependencies on the vendor entity files. This also fixes the path to the vendor script, which was given relatively before, which obviously won't work when running from inside a deeper subdirectory. To speed things up, pass the --vendor option to getinfo, so we do not have to find out the current vendor in getinfo all over again. Gbp-Dch: ignore
Diffstat (limited to 'CMake/vendor_substitute.cmake')
-rw-r--r--CMake/vendor_substitute.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMake/vendor_substitute.cmake b/CMake/vendor_substitute.cmake
new file mode 100644
index 000000000..71449c9e8
--- /dev/null
+++ b/CMake/vendor_substitute.cmake
@@ -0,0 +1,8 @@
+file(READ ${IN} input)
+foreach(variable ${VARS})
+ execute_process(COMMAND ${PROJECT_SOURCE_DIR}/vendor/getinfo
+ --vendor ${CURRENT_VENDOR} ${variable}
+ OUTPUT_VARIABLE value OUTPUT_STRIP_TRAILING_WHITESPACE)
+ string(REPLACE "&${variable};" "${value}" input "${input}")
+endforeach()
+file(WRITE ${OUT} "${input}")