1 # Determine the current vendor, export to CURRENT_VENDOR
2 if (NOT DEFINED CURRENT_VENDOR)
3 execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/getinfo current
4 OUTPUT_VARIABLE CURRENT_VENDOR_OUT OUTPUT_STRIP_TRAILING_WHITESPACE)
6 set(CURRENT_VENDOR "${CURRENT_VENDOR_OUT}" CACHE STRING "Select the system vendor")
7 message(STATUS "Detected vendor: ${CURRENT_VENDOR_OUT}")
9 message(STATUS "Detected vendor: ${CURRENT_VENDOR} (cached)")
12 # Handle sources.list example
13 add_vendor_file(OUTPUT sources.list
14 INPUT "${CURRENT_VENDOR}/sources.list.in"
16 VARIABLES sourceslist-list-format
17 debian-stable-codename
18 debian-oldstable-codename
19 debian-testing-codename
22 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sources.list
23 DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
25 # Handle apt.conf snippets
26 file(GLOB conffiles ${CURRENT_VENDOR}/apt.conf-*)
27 foreach(file ${conffiles})
28 file(RELATIVE_PATH confname ${CMAKE_CURRENT_SOURCE_DIR}/${CURRENT_VENDOR}/ ${file})
29 string(REPLACE "apt.conf-" "" confname "${confname}")
30 install(FILES "${file}"
31 DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/apt/apt.conf.d/"
35 if (EXISTS "${CURRENT_VENDOR}/CMakeLists.txt")
36 add_subdirectory(${CURRENT_VENDOR})