summaryrefslogtreecommitdiffstats
path: root/vendor/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
commit851b6a097165af4d51c0db01b5e05256e5006896 (patch)
tree5f7c388ec894a7806c49a99f3bdb605d0b299a7c /vendor/CMakeLists.txt
parentInitial commit. (diff)
downloadapt-851b6a097165af4d51c0db01b5e05256e5006896.tar.xz
apt-851b6a097165af4d51c0db01b5e05256e5006896.zip
Adding upstream version 2.6.1.upstream/2.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/CMakeLists.txt')
-rw-r--r--vendor/CMakeLists.txt39
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/CMakeLists.txt b/vendor/CMakeLists.txt
new file mode 100644
index 0000000..f6d8869
--- /dev/null
+++ b/vendor/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Determine the current vendor, export to CURRENT_VENDOR
+if (NOT DEFINED CURRENT_VENDOR)
+ execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/getinfo current
+ OUTPUT_VARIABLE CURRENT_VENDOR_OUT OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ 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
+if (WITH_DOC OR WITH_DOC_EXAMPLES)
+add_vendor_file(OUTPUT sources.list
+ INPUT "${CURRENT_VENDOR}/sources.list.in"
+ MODE 644
+ VARIABLES sourceslist-list-format
+ debian-stable-codename
+ debian-oldstable-codename
+ debian-testing-codename
+ ubuntu-codename
+ current-codename)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sources.list
+ DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
+endif()
+
+# Handle apt.conf snippets
+file(GLOB conffiles ${CURRENT_VENDOR}/apt.conf-*)
+foreach(file ${conffiles})
+ file(RELATIVE_PATH confname ${CMAKE_CURRENT_SOURCE_DIR}/${CURRENT_VENDOR}/ ${file})
+ string(REPLACE "apt.conf-" "" confname "${confname}")
+ install(FILES "${file}"
+ DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/apt/apt.conf.d/"
+ RENAME "${confname}")
+endforeach()
+
+if (EXISTS "${CURRENT_VENDOR}/CMakeLists.txt")
+ add_subdirectory(${CURRENT_VENDOR})
+endif()