1 # Include apt-pkg directly, as some files have #include <system.h>
2 include_directories(${PROJECT_BINARY_DIR}/include/apt-pkg)
4 # Set the version of the library
7 set(APT_INST_MAJOR ${MAJOR} PARENT_SCOPE)
9 # Definition of the C++ files used to build the library
10 file(GLOB_RECURSE library "*.cc")
11 file(GLOB_RECURSE headers "*.h")
13 # Create a library using the C++ files
14 add_library(apt-inst SHARED ${library})
16 # Link the library and set the SONAME
17 target_link_libraries(apt-inst PUBLIC apt-pkg ${CMAKE_THREAD_LIBS_INIT})
18 target_link_libraries(apt-inst PRIVATE ${CMAKE_THREAD_LIBS_INIT})
19 set_target_properties(apt-inst PROPERTIES VERSION ${MAJOR}.${MINOR})
20 set_target_properties(apt-inst PROPERTIES SOVERSION ${MAJOR})
21 add_version_script(apt-inst)
23 # Install the library and the headers
24 install(TARGETS apt-inst LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
25 install(FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/apt-pkg)
26 flatify(${PROJECT_BINARY_DIR}/include/apt-pkg/ "${headers}")