Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -283,6 +283,10 @@ "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)") mark_as_advanced(LLVM_TOOLS_INSTALL_DIR) +set(LLVM_SOVERSION_SUFFIX "" CACHE STRING + "Additional suffix appended to SONAME of LLVM libraries") +mark_as_advanced(LLVM_SOVERSION_SUFFIX) + # They are used as destination of target generators. set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) Index: cmake/modules/AddLLVM.cmake =================================================================== --- cmake/modules/AddLLVM.cmake +++ cmake/modules/AddLLVM.cmake @@ -479,8 +479,8 @@ set_target_properties(${name} PROPERTIES # Since 4.0.0, the ABI version is indicated by the major version - SOVERSION ${LLVM_VERSION_MAJOR} - VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}) + SOVERSION ${LLVM_VERSION_MAJOR}${LLVM_SOVERSION_SUFFIX} + VERSION ${LLVM_VERSION_MAJOR}${LLVM_SOVERSION_SUFFIX}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}) endif() endif() Index: cmake/modules/LLVMConfig.cmake.in =================================================================== --- cmake/modules/LLVMConfig.cmake.in +++ cmake/modules/LLVMConfig.cmake.in @@ -57,6 +57,7 @@ set(LLVM_ON_WIN32 @LLVM_ON_WIN32@) set(LLVM_LIBDIR_SUFFIX @LLVM_LIBDIR_SUFFIX@) +set(LLVM_SOVERSION_SUFFIX @LLVM_SOVERSION_SUFFIX@) set(LLVM_INCLUDE_DIRS "@LLVM_CONFIG_INCLUDE_DIRS@") set(LLVM_LIBRARY_DIRS "@LLVM_CONFIG_LIBRARY_DIRS@")