summaryrefslogtreecommitdiff
path: root/methods
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 /methods
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 'methods')
-rw-r--r--methods/CMakeLists.txt35
1 files changed, 35 insertions, 0 deletions
diff --git a/methods/CMakeLists.txt b/methods/CMakeLists.txt
new file mode 100644
index 000000000..2417c4dc1
--- /dev/null
+++ b/methods/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Create the executable targets
+add_executable(file file.cc)
+add_executable(copy copy.cc)
+add_executable(store store.cc)
+add_executable(gpgv gpgv.cc)
+add_executable(cdrom cdrom.cc)
+add_executable(http http.cc http_main.cc rfc2553emu.cc connect.cc server.cc)
+add_executable(mirror mirror.cc http.cc rfc2553emu.cc connect.cc server.cc)
+add_executable(https https.cc server.cc)
+add_executable(ftp ftp.cc rfc2553emu.cc connect.cc)
+add_executable(rred rred.cc)
+add_executable(rsh rsh.cc)
+
+# Add target-specific header directories
+target_include_directories(https PRIVATE ${CURL_INCLUDE_DIRS})
+
+# Link the executables against the libraries
+target_link_libraries(file apt-pkg)
+target_link_libraries(copy apt-pkg)
+target_link_libraries(store apt-pkg)
+target_link_libraries(gpgv apt-pkg)
+target_link_libraries(cdrom apt-pkg)
+target_link_libraries(http apt-pkg)
+target_link_libraries(mirror apt-pkg -lresolv)
+target_link_libraries(https apt-pkg ${CURL_LIBRARIES})
+target_link_libraries(ftp apt-pkg)
+target_link_libraries(rred apt-pkg)
+target_link_libraries(rsh apt-pkg)
+
+# Install the library
+install(TARGETS file copy store gpgv cdrom http https ftp rred rsh mirror
+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/methods)
+
+add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods store gzip lzma bzip2 xz)
+add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods rsh ssh)