You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
1.3 KiB

  1. # Include apt-pkg directly, as some files have #include <system.h>
  2. include_directories(${PROJECT_BINARY_DIR}/include/apt-pkg)
  3. # Set the version of the library
  4. set(MAJOR 3.0)
  5. set(MINOR 0)
  6. set(APT_INST_MAJOR ${MAJOR} PARENT_SCOPE)
  7. # Definition of the C++ files used to build the library - note that this
  8. # is expanded at CMake time, so you have to rerun cmake if you add or remove
  9. # a file (you can just run cmake . in the build directory)
  10. file(GLOB_RECURSE library "*.cc")
  11. file(GLOB_RECURSE headers "*.h")
  12. configure_file(apt-inst.pc.in ${CMAKE_CURRENT_BINARY_DIR}/apt-inst.pc @ONLY)
  13. # Create a library using the C++ files
  14. add_library(apt-inst SHARED ${library})
  15. # Link the library and set the SONAME
  16. target_link_libraries(apt-inst PUBLIC apt-pkg ${CMAKE_THREAD_LIBS_INIT})
  17. target_link_libraries(apt-inst PRIVATE ${CMAKE_THREAD_LIBS_INIT})
  18. set_target_properties(apt-inst PROPERTIES VERSION ${MAJOR}.${MINOR})
  19. set_target_properties(apt-inst PROPERTIES SOVERSION ${MAJOR})
  20. add_version_script(apt-inst)
  21. # Install the library and the headers
  22. install(TARGETS apt-inst LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
  23. install(FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/apt-pkg)
  24. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/apt-inst.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
  25. flatify(${PROJECT_BINARY_DIR}/include/apt-pkg/ "${headers}")