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. --- cmdline/CMakeLists.txt | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 cmdline/CMakeLists.txt (limited to 'cmdline') diff --git a/cmdline/CMakeLists.txt b/cmdline/CMakeLists.txt new file mode 100644 index 000000000..8977b45d1 --- /dev/null +++ b/cmdline/CMakeLists.txt @@ -0,0 +1,59 @@ +# Create the executable tasks +add_executable(apt apt.cc) +add_executable(apt-cache apt-cache.cc) +add_executable(apt-get apt-get.cc) +add_executable(apt-mark apt-mark.cc) +add_executable(apt-config apt-config.cc) +add_executable(apt-cdrom apt-cdrom.cc) +add_executable(apt-helper apt-helper.cc) +add_executable(apt-sortpkgs apt-sortpkgs.cc) +add_executable(apt-extracttemplates apt-extracttemplates.cc) +add_executable(apt-internal-solver apt-internal-solver.cc) +add_executable(apt-dump-solver apt-dump-solver.cc) +add_executable(apt-internal-planner apt-internal-planner.cc) +add_vendor_file(OUTPUT apt-key + INPUT apt-key.in + MODE 755 + VARIABLES keyring-filename + keyring-removed-filename + keyring-master-filename + keyring-uri keyring-package) + + +# Link the executables against the libraries +target_link_libraries(apt apt-pkg apt-private) +target_link_libraries(apt-cache apt-pkg apt-private) +target_link_libraries(apt-get apt-pkg apt-private) +target_link_libraries(apt-config apt-pkg apt-private) +target_link_libraries(apt-cdrom apt-pkg apt-private) +target_link_libraries(apt-helper apt-pkg apt-private) +target_link_libraries(apt-mark apt-pkg apt-private) +target_link_libraries(apt-sortpkgs apt-pkg apt-private) +target_link_libraries(apt-extracttemplates apt-pkg apt-inst apt-private) +target_link_libraries(apt-internal-solver apt-pkg apt-inst apt-private) +target_link_libraries(apt-dump-solver apt-pkg apt-inst apt-private) +target_link_libraries(apt-internal-planner apt-pkg apt-inst apt-private) + +set_target_properties(apt-dump-solver + PROPERTIES RUNTIME_OUTPUT_DIRECTORY solvers + RUNTIME_OUTPUT_NAME dump) +set_target_properties(apt-internal-solver + PROPERTIES RUNTIME_OUTPUT_DIRECTORY solvers + RUNTIME_OUTPUT_NAME apt) +set_target_properties(apt-internal-planner + PROPERTIES RUNTIME_OUTPUT_DIRECTORY planners + RUNTIME_OUTPUT_NAME apt) + +# Install the executables +install(TARGETS apt apt-cache apt-get apt-config apt-cdrom apt-mark apt-sortpkgs + apt-extracttemplates + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +install(TARGETS apt-helper RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/) +install(TARGETS apt-dump-solver apt-internal-solver RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/solvers) +install(TARGETS apt-internal-planner RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/planners) + +add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/planners ../solvers/dump planners/dump) + +# Install the not-to-be-compiled programs +INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/apt-key DESTINATION ${CMAKE_INSTALL_BINDIR}) -- 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. --- cmdline/makefile | 119 ------------------------------------------------------- 1 file changed, 119 deletions(-) delete mode 100644 cmdline/makefile (limited to 'cmdline') diff --git a/cmdline/makefile b/cmdline/makefile deleted file mode 100644 index 8b79ce05f..000000000 --- a/cmdline/makefile +++ /dev/null @@ -1,119 +0,0 @@ -# -*- make -*- -BASE=.. -SUBDIR=cmdline - -# Bring in the default rules -include ../buildlib/defaults.mak - -# The apt program -PROGRAM=apt -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile apt-private/makefile -SOURCE = apt.cc -include $(PROGRAM_H) - -# The apt-cache program -PROGRAM=apt-cache -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile apt-private/makefile -SOURCE = apt-cache.cc -include $(PROGRAM_H) - -# The apt-get program -PROGRAM=apt-get -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile apt-private/makefile -SOURCE = apt-get.cc -include $(PROGRAM_H) - -# The apt-config program -PROGRAM=apt-config -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile apt-private/makefile -SOURCE = apt-config.cc -include $(PROGRAM_H) - -# The apt-cdrom program -PROGRAM=apt-cdrom -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile apt-private/makefile -SOURCE = apt-cdrom.cc -include $(PROGRAM_H) - -# The apt-mark program -PROGRAM=apt-mark -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile apt-private/makefile -SOURCE = apt-mark.cc -include $(PROGRAM_H) - -# The apt-helper -PROGRAM=apt-helper -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -lresolv -LIB_MAKES = apt-pkg/makefile apt-private/makefile -SOURCE = apt-helper.cc -include $(PROGRAM_H) - -# The apt-report-mirror-failure program -#SOURCE=apt-report-mirror-failure -#TO=$(BIN) -#TARGET=program -#include $(COPY_H) - -# -# the following programs are shipped in apt-utils -# -APT_DOMAIN:=apt-utils - -# The apt-sortpkgs program -PROGRAM=apt-sortpkgs -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile apt-private/makefile -SOURCE = apt-sortpkgs.cc -include $(PROGRAM_H) - -# The apt-extracttemplates program -PROGRAM=apt-extracttemplates -SLIBS = -lapt-pkg -lapt-inst -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile apt-inst/makefile apt-private/makefile -SOURCE = apt-extracttemplates.cc -include $(PROGRAM_H) - -# The internal solver/planner acting as an external -PROGRAM=apt-internal-solver -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile apt-private/makefile -SOURCE = apt-internal-solver.cc -include $(PROGRAM_H) - -PROGRAM=apt-internal-planner -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile apt-private/makefile -SOURCE = apt-internal-planner.cc -include $(PROGRAM_H) - -# This just dumps out the state -PROGRAM=apt-dump-solver -SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile apt-private/makefile -SOURCE = apt-dump-solver.cc -include $(PROGRAM_H) - -# The apt-key program -apt-key: apt-key.in - sed -e "s#&keyring-filename;#$(shell ../vendor/getinfo keyring-filename)#" \ - -e "s#&keyring-removed-filename;#$(shell ../vendor/getinfo keyring-removed-filename)#" \ - -e "s#&keyring-master-filename;#$(shell ../vendor/getinfo keyring-master-filename)#" \ - -e "s#&keyring-uri;#$(shell ../vendor/getinfo keyring-uri)#" \ - -e "s#&keyring-package;#$(shell ../vendor/getinfo keyring-package)#" $< > $@ - chmod 755 $@ - -SOURCE=apt-key -TO=$(BIN) -TARGET=program -include $(COPY_H) - -clean: clean/apt-key - -clean/apt-key: - rm -f apt-key -- cgit v1.2.3