2
0

Versioning.cmake 595 B

123456789101112131415161718192021
  1. # Filename: Versioning.cmake
  2. #
  3. # Description: Contains an override for add_library to set the
  4. # VERSION and SOVERSION properties on all shared libraries, automatically, to
  5. # the project version.
  6. #
  7. # Functions:
  8. # add_library(...)
  9. #
  10. function(add_library target_name)
  11. _add_library("${target_name}" ${ARGN})
  12. get_target_property(type "${target_name}" TYPE)
  13. if(type STREQUAL "SHARED_LIBRARY")
  14. set_target_properties("${target_name}" PROPERTIES
  15. VERSION "${PROJECT_VERSION}"
  16. SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
  17. endif()
  18. endfunction(add_library)