SDL_net: cmake: fix macho {compatibility,current} version (33531)

From 33531ee02f59640056947f8e4f0ee1a805916ca6 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Wed, 1 May 2024 22:10:04 +0200
Subject: [PATCH] cmake: fix macho {compatibility,current} version

---
 CMakeLists.txt | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a9c738..291959e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -118,18 +118,14 @@ set_target_properties(SDL2_net PROPERTIES
 if(NOT ANDROID)
     set_target_properties(SDL2_net PROPERTIES
         DEBUG_POSTFIX "${SDL2NET_DEBUG_POSTFIX}"
+        SOVERSION "${LT_MAJOR}"
+        VERSION "${LT_VERSION}"
     )
     if(APPLE)
-        # the SOVERSION property corresponds to the compatibility version and VERSION corresponds to the current version
-        # https://cmake.org/cmake/help/latest/prop_tgt/SOVERSION.html#mach-o-versions
+        cmake_minimum_required(VERSION 3.17)
         set_target_properties(SDL2_net PROPERTIES
-            SOVERSION "${DYLIB_COMPATIBILITY_VERSION}"
-            VERSION "${DYLIB_CURRENT_VERSION}"
-        )
-    else()
-        set_target_properties(SDL2_net PROPERTIES
-            SOVERSION "${LT_MAJOR}"
-            VERSION "${LT_VERSION}"
+            MACHO_COMPATIBILITY_VERSION "${DYLIB_COMPATIBILITY_VERSION}"
+            MACHO_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}"
         )
     endif()
 endif()