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. --- apt-inst/CMakeLists.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 apt-inst/CMakeLists.txt (limited to 'apt-inst') diff --git a/apt-inst/CMakeLists.txt b/apt-inst/CMakeLists.txt new file mode 100644 index 000000000..f7578231a --- /dev/null +++ b/apt-inst/CMakeLists.txt @@ -0,0 +1,26 @@ +# Include apt-pkg directly, as some files have #include +include_directories(${PROJECT_BINARY_DIR}/include/apt-pkg) + +# Set the version of the library +set(MAJOR 2.0) +set(MINOR 0) +set(APT_INST_MAJOR ${MAJOR} PARENT_SCOPE) + +# Definition of the C++ files used to build the library +file(GLOB_RECURSE library "*.cc") +file(GLOB_RECURSE headers "*.h") + +# Create a library using the C++ files +add_library(apt-inst SHARED ${library}) + +# Link the library and set the SONAME +target_link_libraries(apt-inst PUBLIC apt-pkg ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(apt-inst PRIVATE ${CMAKE_THREAD_LIBS_INIT}) +set_target_properties(apt-inst PROPERTIES VERSION ${MAJOR}.${MINOR}) +set_target_properties(apt-inst PROPERTIES SOVERSION ${MAJOR}) +add_version_script(apt-inst) + +# Install the library and the headers +install(TARGETS apt-inst LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/apt-pkg) +flatify(${PROJECT_BINARY_DIR}/include/apt-pkg/ "${headers}") -- cgit v1.2.3