summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-07 03:33:11 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-10 16:10:48 +0200
commit0fead28404498f42324dd86b4246d35af8905ed3 (patch)
treec1f0e979042989c7539e528f593422fd48b69dfb /vendor
parent79635b696b1ca113d0527d4afe96908eada5cc48 (diff)
CMake: Cache CURRENT_VENDOR and make it configurable
Cache the current vendor, so we do not have to rerun getinfo when reconfiguring stuff. This also has the nice effect of making the vendor configurable, so you can manually specify it on a platform that might not have dpkg (not that building without dpkg works yet). Gbp-Dch: ignore
Diffstat (limited to 'vendor')
-rw-r--r--vendor/CMakeLists.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/vendor/CMakeLists.txt b/vendor/CMakeLists.txt
index 72aad49e1..8246c725a 100644
--- a/vendor/CMakeLists.txt
+++ b/vendor/CMakeLists.txt
@@ -1,9 +1,13 @@
# Determine the current vendor, export to CURRENT_VENDOR
-execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/getinfo current
- OUTPUT_VARIABLE CURRENT_VENDOR OUTPUT_STRIP_TRAILING_WHITESPACE)
-set(CURRENT_VENDOR ${CURRENT_VENDOR} PARENT_SCOPE)
+if (NOT DEFINED CURRENT_VENDOR)
+ execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/getinfo current
+ OUTPUT_VARIABLE CURRENT_VENDOR_OUT OUTPUT_STRIP_TRAILING_WHITESPACE)
-message(STATUS "Detected vendor: ${CURRENT_VENDOR}")
+ set(CURRENT_VENDOR "${CURRENT_VENDOR_OUT}" CACHE STRING "Select the system vendor")
+ message(STATUS "Detected vendor: ${CURRENT_VENDOR_OUT}")
+else()
+ message(STATUS "Detected vendor: ${CURRENT_VENDOR} (cached)")
+endif()
# Handle sources.list example
add_vendor_file(OUTPUT sources.list