]> git.saurik.com Git - apt.git/blame - apt-inst/CMakeLists.txt
Add statvfs.h.in to CMake directory
[apt.git] / apt-inst / CMakeLists.txt
CommitLineData
f3de2dba
JAK
1# Include apt-pkg directly, as some files have #include <system.h>
2include_directories(${PROJECT_BINARY_DIR}/include/apt-pkg)
3
4# Set the version of the library
5set(MAJOR 2.0)
6set(MINOR 0)
7set(APT_INST_MAJOR ${MAJOR} PARENT_SCOPE)
8
9# Definition of the C++ files used to build the library
10file(GLOB_RECURSE library "*.cc")
11file(GLOB_RECURSE headers "*.h")
12
13# Create a library using the C++ files
14add_library(apt-inst SHARED ${library})
15
16# Link the library and set the SONAME
17target_link_libraries(apt-inst PUBLIC apt-pkg ${CMAKE_THREAD_LIBS_INIT})
18target_link_libraries(apt-inst PRIVATE ${CMAKE_THREAD_LIBS_INIT})
19set_target_properties(apt-inst PROPERTIES VERSION ${MAJOR}.${MINOR})
20set_target_properties(apt-inst PROPERTIES SOVERSION ${MAJOR})
21add_version_script(apt-inst)
22
23# Install the library and the headers
24install(TARGETS apt-inst LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
25install(FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/apt-pkg)
26flatify(${PROJECT_BINARY_DIR}/include/apt-pkg/ "${headers}")