revert findsdl2.cmake

This commit is contained in:
Squall-Leonhart 2024-01-24 11:56:45 +11:00
parent bd734fb019
commit d71942f7a4
1 changed files with 15 additions and 16 deletions

View File

@ -204,22 +204,21 @@ IF(SDL2_LIBRARY_TEMP)
# Add libsamplerate with vcpkg # Add libsamplerate with vcpkg
if(CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg") if(CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg")
find_package(SampleRate CONFIG REQUIRED) if(WIN32)
if(WIN32) unset(arch_suffix)
unset(arch_suffix) unset(path_prefix)
unset(path_prefix) if(VCPKG_TARGET_TRIPLET MATCHES -static)
if(VCPKG_TARGET_TRIPLET MATCHES -static) set(arch_suffix -static)
set(arch_suffix -static)
endif()
if(CMAKE_BUILD_TYPE MATCHES "^(Debug|RelWithDebInfo)$")
set(path_prefix debug)
endif()
set(installed_prefix ${_VCPKG_INSTALLED_DIR}/${WINARCH}-windows${arch_suffix}/${path_prefix})
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} SampleRate::samplerate)
else()
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} SampleRate::samplerate)
endif() endif()
if(CMAKE_BUILD_TYPE MATCHES "^(Debug|RelWithDebInfo)$")
set(path_prefix debug)
endif()
set(installed_prefix ${_VCPKG_INSTALLED_DIR}/${WINARCH}-windows${arch_suffix}/${path_prefix})
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${installed_prefix}/lib/samplerate.lib)
else()
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} -lsamplerate)
endif()
endif() endif()
# Add some stuff from pkg-config, if available # Add some stuff from pkg-config, if available
@ -261,4 +260,4 @@ ENDIF(SDL2_LIBRARY_TEMP)
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)