diff --git a/CMakeLists.txt b/CMakeLists.txt index 68e9ea7a68..28a970ec64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,7 @@ include(AddFlexTarget) # Defines add_flex_target function include(CompositeSources) # Defines composite_sources function include(Interrogate) # Defines target_interrogate AND add_python_module include(RunPzip) # Defines run_pzip function +include(Versioning) # Hooks 'add_library' to apply VERSION/SOVERSION # Add the include path for source and header files generated by CMake include_directories("${PROJECT_BINARY_DIR}/include") diff --git a/cmake/macros/Versioning.cmake b/cmake/macros/Versioning.cmake new file mode 100644 index 0000000000..b32e5a3201 --- /dev/null +++ b/cmake/macros/Versioning.cmake @@ -0,0 +1,6 @@ +function(add_library target_name) + _add_library("${target_name}" ${ARGN}) + set_target_properties("${target_name}" PROPERTIES + VERSION "${PROJECT_VERSION}" + SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") +endfunction(add_library)