]> git.saurik.com Git - apt.git/blame - vendor/CMakeLists.txt
CMake: Use find_package() for curl instead of pkg_check_modules()
[apt.git] / vendor / CMakeLists.txt
CommitLineData
f3de2dba
JAK
1# Determine the current vendor, export to CURRENT_VENDOR
2execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/getinfo current
3 OUTPUT_VARIABLE CURRENT_VENDOR OUTPUT_STRIP_TRAILING_WHITESPACE)
4set(CURRENT_VENDOR ${CURRENT_VENDOR} PARENT_SCOPE)
5
6message(STATUS "Detected vendor: ${CURRENT_VENDOR}")
7
8# Handle sources.list example
9add_vendor_file(OUTPUT sources.list
10 INPUT "${CURRENT_VENDOR}/sources.list.in"
11 MODE 644
12 VARIABLES sourceslist-list-format
13 debian-stable-codename
14 debian-oldstable-codename
15 debian-testing-codename
16 ubuntu-codename
17 current-codename)
18install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sources.list
19 DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
20
21# Handle apt.conf snippets
22file(GLOB conffiles ${CURRENT_VENDOR}/apt.conf-*)
23foreach(file ${conffiles})
24 file(RELATIVE_PATH confname ${CMAKE_CURRENT_SOURCE_DIR}/${CURRENT_VENDOR}/ ${file})
25 string(REPLACE "apt.conf-" "" confname "${confname}")
26 install(FILES "${file}"
27 DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/apt/apt.conf.d/"
28 RENAME "${confname}")
29endforeach()
30
31if (EXISTS "${CURRENT_VENDOR}/CMakeLists.txt")
32 add_subdirectory(${CURRENT_VENDOR})
33endif()