summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-06 21:03:43 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-06 22:36:02 +0200
commitf3de2dbaf657f9040a4da448c57267de0fef7d33 (patch)
treed3b44456dd66f619f29671d56589f0257e986d7a /vendor
parentcc1b834fe966d40206d148e1f27f0502463ac69f (diff)
CMake: Add basic CMake build system
Introduce an initial CMake buildsystem. This build system can build a fully working apt system without translation or documentation. The FindBerkelyDB module is from kdelibs, with some small adjustements to also look in db5 directories. Initial work on this CMake build system started in 2009, and was resumed in August 2016.
Diffstat (limited to 'vendor')
-rw-r--r--vendor/CMakeLists.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/vendor/CMakeLists.txt b/vendor/CMakeLists.txt
new file mode 100644
index 000000000..72aad49e1
--- /dev/null
+++ b/vendor/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Determine the current vendor, export to CURRENT_VENDOR
+execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/getinfo current
+ OUTPUT_VARIABLE CURRENT_VENDOR OUTPUT_STRIP_TRAILING_WHITESPACE)
+set(CURRENT_VENDOR ${CURRENT_VENDOR} PARENT_SCOPE)
+
+message(STATUS "Detected vendor: ${CURRENT_VENDOR}")
+
+# Handle sources.list example
+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)
+
+# 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()