vcpkg/ports/sdl2-mixer/fix-deps-targets.patch

138 lines
5.0 KiB
Diff
Raw Normal View History

2023-03-22 03:40:45 +08:00
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 54317572..5f84dd22 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -366,7 +366,7 @@ if(SDL2MIXER_OPUS)
endif()
else()
message(STATUS "Using system opusfile")
- find_package(opusfile REQUIRED)
+ find_package(OpusFile CONFIG REQUIRED)
if(NOT SDL2MIXER_OPUS_SHARED)
list(APPEND PC_REQUIRES opusfile)
endif()
@@ -384,7 +384,7 @@ if(SDL2MIXER_OPUS)
add_dependencies(SDL2_mixer opusfile::opusfile)
endif()
else()
- target_link_libraries(SDL2_mixer PRIVATE opusfile::opusfile)
+ target_link_libraries(SDL2_mixer PRIVATE OpusFile::opusfile)
endif()
endif()
@@ -467,7 +467,7 @@ if(SDL2MIXER_VORBIS_VORBISFILE)
endif()
else()
message(STATUS "Using system vorbisfile")
- find_package(vorbisfile REQUIRED)
+ find_package(Vorbis CONFIG REQUIRED)
if(NOT SDL2MIXER_VORBIS_VORBISFILE_SHARED)
list(APPEND PC_REQUIRES vorbisfile)
endif()
@@ -485,7 +485,7 @@ if(SDL2MIXER_VORBIS_VORBISFILE)
add_dependencies(SDL2_mixer vorbisfile::vorbisfile)
endif()
else()
- target_link_libraries(SDL2_mixer PRIVATE vorbisfile::vorbisfile)
+ target_link_libraries(SDL2_mixer PRIVATE Vorbis::vorbisfile)
endif()
endif()
@@ -510,7 +510,7 @@ if(SDL2MIXER_FLAC_LIBFLAC)
endif()
else()
message(STATUS "Using system libflac")
- find_package(FLAC REQUIRED)
+ find_package(FLAC CONFIG REQUIRED)
if(NOT SDL2MIXER_FLAC_LIBFLAC_SHARED)
list(APPEND PC_REQUIRES flac)
endif()
@@ -528,7 +528,7 @@ if(SDL2MIXER_FLAC_LIBFLAC)
add_dependencies(SDL2_mixer FLAC)
endif()
else()
- target_link_libraries(SDL2_mixer PRIVATE FLAC)
+ target_link_libraries(SDL2_mixer PRIVATE FLAC::FLAC)
endif()
endif()
@@ -643,7 +643,7 @@ if(SDL2MIXER_MP3_MPG123)
endif()
else()
message(STATUS "Using system mpg123")
- find_package(MPG123 REQUIRED)
+ find_package(MPG123 CONFIG REQUIRED)
if(NOT SDL2MIXER_MP3_MPG123_SHARED)
list(APPEND PC_REQUIRES libmpg123)
endif()
@@ -661,7 +661,7 @@ if(SDL2MIXER_MP3_MPG123)
add_dependencies(SDL2_mixer MPG123::mpg123)
endif()
else()
- target_link_libraries(SDL2_mixer PRIVATE MPG123::mpg123)
+ target_link_libraries(SDL2_mixer PRIVATE MPG123::libmpg123)
endif()
endif()
@@ -672,7 +672,7 @@ if(SDL2MIXER_MIDI_FLUIDSYNTH)
message(FATAL_ERROR "FluidSynth is not vendored.")
else()
message(STATUS "Using system FluidSynth")
- find_package(FluidSynth REQUIRED)
+ find_package(FluidSynth CONFIG REQUIRED)
if(NOT SDL2MIXER_MIDI_FLUIDSYNTH_SHARED)
list(APPEND PC_REQUIRES fluidsynth)
endif()
@@ -690,7 +690,7 @@ if(SDL2MIXER_MIDI_FLUIDSYNTH)
add_dependencies(SDL2_mixer FluidSynth::FluidSynth)
endif()
else()
- target_link_libraries(SDL2_mixer PRIVATE FluidSynth::FluidSynth)
+ target_link_libraries(SDL2_mixer PRIVATE FluidSynth::libfluidsynth)
endif()
endif()
diff --git a/SDL2_mixerConfig.cmake.in b/SDL2_mixerConfig.cmake.in
index d65a43ce..29866349 100644
--- a/SDL2_mixerConfig.cmake.in
+++ b/SDL2_mixerConfig.cmake.in
@@ -54,7 +54,7 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer-static-targets.cmake")
include(CMakeFindDependencyMacro)
if(SDL2MIXER_FLAC_LIBFLAC AND NOT SDL2MIXER_VENDORED AND NOT TARGET FLAC::FLAC)
- find_dependency(FLAC)
+ find_dependency(FLAC CONFIG)
endif()
if(SDL2MIXER_MOD_MODPLUG AND NOT SDL2MIXER_VENDORED AND NOT TARGET modplug::modplug)
@@ -69,20 +69,23 @@ include(CMakeFindDependencyMacro)
find_dependency(libxmp-lite)
endif()
- if(SDL2MIXER_MP3_MPG123 AND NOT SDL2MIXER_VENDORED AND NOT TARGET MPG123::mpg123)
- find_dependency(MPG123)
+ if(SDL2MIXER_MP3_MPG123 AND NOT SDL2MIXER_VENDORED AND NOT TARGET MPG123::libmpg123)
+ find_dependency(MPG123 CONFIG)
endif()
- if(SDL2MIXER_MIDI_FLUIDSYNTH AND NOT SDL2MIXER_VENDORED AND NOT TARGET FluidSynth::FluidSynth)
- find_dependency(FluidSynth)
+ if(SDL2MIXER_MIDI_FLUIDSYNTH AND NOT SDL2MIXER_VENDORED AND NOT TARGET FluidSynth::libfluidsynth)
+ find_dependency(FluidSynth CONFIG)
endif()
if(SDL2MIXER_VORBIS_TREMOR AND NOT SDL2MIXER_VENDORED AND NOT TARGET tremor::tremor)
find_dependency(tremor)
endif()
- if(SDL2MIXER_VORBIS_VORBISFILE AND NOT SDL2MIXER_VENDORED AND NOT TARGET vorbisfile::vorbisfile)
- find_dependency(vorbisfile)
+ if(SDL2MIXER_VORBIS_VORBISFILE AND NOT SDL2MIXER_VENDORED AND NOT TARGET Vorbis::vorbisfile)
+ find_dependency(Vorbis CONFIG)
+ endif()
+ if(SDL2MIXER_OPUS AND NOT SDL2MIXER_VENDORED AND NOT TARGET OpusFile::opusfile)
+ find_dependency(OpusFile CONFIG)
endif()
if((NOT SDL2MIXER_VENDORED AND SDL2MIXER_MOD_MODPLUG) OR (HAIKU AND SDL2MIXER_MIDI_NATIVE))