From f3de2dbaf657f9040a4da448c57267de0fef7d33 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 6 Aug 2016 21:03:43 +0200 Subject: 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. --- methods/CMakeLists.txt | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 methods/CMakeLists.txt (limited to 'methods') 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) -- cgit v1.2.3 From c85c4bed0a4b32ee2dcbd86ea819e39f3d8beb84 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 9 Aug 2016 17:40:01 +0200 Subject: Get rid of the old buildsystem Bye, bye, old friend. --- methods/makefile | 110 ------------------------------------------------------- 1 file changed, 110 deletions(-) delete mode 100644 methods/makefile (limited to 'methods') diff --git a/methods/makefile b/methods/makefile deleted file mode 100644 index 3274e9279..000000000 --- a/methods/makefile +++ /dev/null @@ -1,110 +0,0 @@ -# -*- make -*- -BASE=.. -SUBDIR=methods - -# Bring in the default rules -include ../buildlib/defaults.mak -BIN := $(BIN)/methods - -include ../buildlib/libversion.mak -APT_DOMAIN := apt - -# The file method -PROGRAM=file -SLIBS = -lapt-pkg $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile -SOURCE = file.cc -include $(PROGRAM_H) - -# The copy method -PROGRAM=copy -SLIBS = -lapt-pkg $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile -SOURCE = copy.cc -include $(PROGRAM_H) - -# The store method -PROGRAM=store -SLIBS = -lapt-pkg $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile -SOURCE = store.cc -include $(PROGRAM_H) - -# The gpgv method -PROGRAM=gpgv -SLIBS = -lapt-pkg $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile -SOURCE = gpgv.cc -include $(PROGRAM_H) - -# The cdrom method -PROGRAM=cdrom -SLIBS = -lapt-pkg $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile -SOURCE = cdrom.cc -include $(PROGRAM_H) - -# The http method -PROGRAM=http -SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) -lresolv -LIB_MAKES = apt-pkg/makefile -SOURCE = http.cc http_main.cc rfc2553emu.cc connect.cc server.cc -include $(PROGRAM_H) - -# The https method -PROGRAM=https -SLIBS = -lapt-pkg -lcurl $(INTLLIBS) -lresolv -LIB_MAKES = apt-pkg/makefile -SOURCE = https.cc server.cc -include $(PROGRAM_H) - -# The ftp method -PROGRAM=ftp -SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) -lresolv -LIB_MAKES = apt-pkg/makefile -SOURCE = ftp.cc rfc2553emu.cc connect.cc -include $(PROGRAM_H) - -# The rred method -PROGRAM=rred -SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile -SOURCE = rred.cc -include $(PROGRAM_H) - -# The rsh method -PROGRAM=rsh -SLIBS = -lapt-pkg $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile -SOURCE = rsh.cc -include $(PROGRAM_H) - -# The mirror method -PROGRAM=mirror -SLIBS = -lapt-pkg $(SOCKETLIBS) -lresolv -LIB_MAKES = apt-pkg/makefile -SOURCE = mirror.cc http.cc rfc2553emu.cc connect.cc server.cc -include $(PROGRAM_H) - -# SSH method symlink -binary: $(BIN)/ssh -veryclean: clean-$(BIN)/ssh - -$(BIN)/ssh: - echo "Installing ssh method link" - ln -fs rsh $(BIN)/ssh -clean-$(BIN)/ssh: - -rm $(BIN)/ssh - -# create compat links for all compressors -COMPRESSORS=gzip bzip2 lzma xz - -binary: $(addprefix $(BIN)/,$(COMPRESSORS)) -veryclean: $(addprefix clean-$(BIN)/,$(COMPRESSORS)) - -$(addprefix $(BIN)/,$(COMPRESSORS)): $(BIN)/store - echo "Installing $(notdir $@) method link" - ln -fs store $@ - -$(addprefix clean-$(BIN)/,$(COMPRESSORS)): - -rm $(BIN)/$(notdir $@) -- cgit v1.2.3