Fix Cmake so generated SOname matches autoconf's #.
authorEdward Rudd <urkle@outoforder.cc>
Mon, 10 Feb 2014 10:53:02 -0500
changeset 8203 5c9ac454116e
parent 8202 b84a1f55075e
child 8204 d010b7f0e5ba
Fix Cmake so generated SOname matches autoconf's #.
CMakeLists.txt
--- a/CMakeLists.txt	Mon Feb 10 11:29:48 2014 -0500
+++ b/CMakeLists.txt	Mon Feb 10 10:53:02 2014 -0500
@@ -37,9 +37,12 @@
 # Calculate a libtool-like version number
 math(EXPR LT_CURRENT "${SDL_MICRO_VERSION} - ${SDL_INTERFACE_AGE}")
 math(EXPR LT_AGE "${SDL_BINARY_AGE} - ${SDL_INTERFACE_AGE}")
+math(EXPR LT_MAJOR "${LT_CURRENT}- ${LT_AGE}")
 set(LT_REVISION "${SDL_INTERFACE_AGE}")
 set(LT_RELEASE "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}")
-set(LT_VERSION "${LT_CURRENT}.${LT_REVISION}.${LT_AGE}")
+set(LT_VERSION "${LT_MAJOR}.${LT_AGE}.${LT_REVISION}")
+
+message(STATUS "${LT_VERSION} :: ${LT_AGE} :: ${LT_REVISION} :: ${LT_CURRENT} :: ${LT_RELEASE}")
 
 # General settings & flags
 set(LIBRARY_OUTPUT_DIRECTORY "build")
@@ -1236,12 +1239,12 @@
   if(UNIX)
     set_target_properties(SDL2 PROPERTIES
       VERSION ${LT_VERSION}
-      SOVERSION ${LT_CURRENT}
+      SOVERSION ${LT_REVISION}
       OUTPUT_NAME "SDL2-${LT_RELEASE}")
   else(UNIX)
     set_target_properties(SDL2 PROPERTIES
       VERSION ${SDL_VERSION}
-      SOVERSION ${LT_CURRENT}
+      SOVERSION ${LT_REVISION}
       OUTPUT_NAME "SDL2")
   endif()
  set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})