summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
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