]>
Commit | Line | Data |
---|---|---|
f3de2dba JAK |
1 | # Determine the current vendor, export to CURRENT_VENDOR |
2 | execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/getinfo current | |
3 | OUTPUT_VARIABLE CURRENT_VENDOR OUTPUT_STRIP_TRAILING_WHITESPACE) | |
4 | set(CURRENT_VENDOR ${CURRENT_VENDOR} PARENT_SCOPE) | |
5 | ||
6 | message(STATUS "Detected vendor: ${CURRENT_VENDOR}") | |
7 | ||
8 | # Handle sources.list example | |
9 | add_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) | |
18 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sources.list | |
19 | DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) | |
20 | ||
21 | # Handle apt.conf snippets | |
22 | file(GLOB conffiles ${CURRENT_VENDOR}/apt.conf-*) | |
23 | foreach(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}") | |
29 | endforeach() | |
30 | ||
31 | if (EXISTS "${CURRENT_VENDOR}/CMakeLists.txt") | |
32 | add_subdirectory(${CURRENT_VENDOR}) | |
33 | endif() |