]> git.saurik.com Git - apt.git/blob - vendor/CMakeLists.txt
Of *course* I managed to get this check backwards.
[apt.git] / vendor / CMakeLists.txt
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)
5
6 set(CURRENT_VENDOR "${CURRENT_VENDOR_OUT}" CACHE STRING "Select the system vendor")
7 message(STATUS "Detected vendor: ${CURRENT_VENDOR_OUT}")
8 else()
9 message(STATUS "Detected vendor: ${CURRENT_VENDOR} (cached)")
10 endif()
11
12 # Handle sources.list example
13 add_vendor_file(OUTPUT sources.list
14 INPUT "${CURRENT_VENDOR}/sources.list.in"
15 MODE 644
16 VARIABLES sourceslist-list-format
17 debian-stable-codename
18 debian-oldstable-codename
19 debian-testing-codename
20 ubuntu-codename
21 current-codename)
22 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sources.list
23 DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
24
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/"
32 RENAME "${confname}")
33 endforeach()
34
35 if (EXISTS "${CURRENT_VENDOR}/CMakeLists.txt")
36 add_subdirectory(${CURRENT_VENDOR})
37 endif()