Specify full shared lib filename in cmake file.

Without this, CMake projects that link against 'SDL2_mixer::SDL2_mixer'
won't be able to find the library. Patch based on equivalent patches in
sdl, sdl2-image, sdl2-ttf.

ok rsadowski@
This commit is contained in:
bentley
2024-07-13 10:46:45 +00:00
parent df999c657c
commit 28030f9894
2 changed files with 16 additions and 1 deletions
+4 -1
View File
@@ -2,7 +2,7 @@ V = 2.8.0
COMMENT = SDL2 multi-channel audio mixer library
DISTNAME = SDL2_mixer-${V}
PKGNAME = sdl2-mixer-${V}
REVISION = 0
REVISION = 1
CATEGORIES = devel audio
SHARED_LIBS += SDL2_mixer 1.1 # 2.8.0
@@ -36,6 +36,9 @@ USE_GMAKE = Yes
NO_TEST = Yes
pre-configure:
${SUBST_CMD} ${WRKSRC}/sdl2_mixer-config.cmake.in
post-install:
${INSTALL_PROGRAM} ${WRKBUILD}/build/.libs/playmus ${PREFIX}/bin/play2mus
${INSTALL_PROGRAM} ${WRKBUILD}/build/.libs/playwave ${PREFIX}/bin/play2wave
@@ -0,0 +1,12 @@
Index: sdl2_mixer-config.cmake.in
--- sdl2_mixer-config.cmake.in.orig
+++ sdl2_mixer-config.cmake.in
@@ -111,7 +111,7 @@ if(NOT TARGET SDL2_mixer::SDL2_mixer)
unset(_sdl2mixer_dll)
unset(_sdl2mixer_imp)
else()
- set(_sdl2mixer_shl "${_sdl2mixer_libdir}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2_mixer${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ set(_sdl2mixer_shl "${_sdl2mixer_libdir}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2_mixer${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBSDL2_mixer_VERSION}")
if(EXISTS "${_sdl2mixer_shl}")
add_library(SDL2_mixer::SDL2_mixer SHARED IMPORTED)
set_target_properties(SDL2_mixer::SDL2_mixer