shithub: opusfile

Download patch

ref: 54056fde8abcc00d3b7f3b22176cab7dd9fb8c65
parent: 0b658cb92454d0d40e8e858e7a6089c6555cbc8a
author: Hendrik <git@h3ndrk.de>
date: Mon May 31 18:07:26 EDT 2021

Add SOVERSION, fix target name

Signed-off-by: Ralph Giles <giles@thaumas.net>
Signed-off-by: evpobr <evpobr@gmail.com>

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,9 @@
 
 include(opusfilePackageVersion)
 get_package_version(PACKAGE_VERSION PROJECT_VERSION)
+string(REPLACE "." ";" PROJECT_VERSION_LIST ${PROJECT_VERSION})
+list(GET PROJECT_VERSION_LIST 0 PROJECT_VERSION_MAJOR)
+list(GET PROJECT_VERSION_LIST 1 PROJECT_VERSION_MINOR)
 
 project(opusfile
   VERSION ${PROJECT_VERSION}
@@ -44,6 +47,8 @@
 add_library(opusfile::opusfile ALIAS opusfile)
 set_target_properties(opusfile PROPERTIES
   PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/include/opusfile.h"
+  VERSION ${PROJECT_VERSION}
+  SOVERSION ${PROJECT_VERSION_MAJOR}
 )
 target_include_directories(opusfile
   PRIVATE
@@ -134,8 +139,10 @@
       "${CMAKE_CURRENT_SOURCE_DIR}/src/winerrno.h"
     )
   endif()
-  set_target_properties(opusfile PROPERTIES
+  set_target_properties(opusurl PROPERTIES
     PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/include/opusfile.h"
+    VERSION ${PROJECT_VERSION}
+    SOVERSION ${PROJECT_VERSION_MAJOR}
   )
   target_include_directories(opusurl
     PRIVATE