yuzu/externals/vcpkg/ports/ogre-next/fix_find_package_sdl2.patch
2022-07-23 03:01:36 +02:00

78 lines
3.2 KiB
Diff
Executable File

diff --git a/CMake/Dependencies.cmake b/CMake/Dependencies.cmake
index 3f3e2d7..0cc9606 100644
--- a/CMake/Dependencies.cmake
+++ b/CMake/Dependencies.cmake
@@ -267,7 +267,7 @@ endif()
#######################################################################
# Find sdl2
-find_package(SDL2)
+find_package(SDL2 CONFIG REQUIRED)
macro_log_feature(SDL2_FOUND "SDL2" "Simple DirectMedia Library" "https://www.libsdl.org/" FALSE "" "")
#######################################################################
diff --git a/CMake/InstallDependencies.cmake b/CMake/InstallDependencies.cmake
index f98b358..e5eb9ed 100644
--- a/CMake/InstallDependencies.cmake
+++ b/CMake/InstallDependencies.cmake
@@ -100,8 +100,6 @@ if (OGRE_INSTALL_DEPENDENCIES)
endif ()
if( OGRE_BUILD_SAMPLES2 )
- install_debug(SDL2.dll)
- install_release(SDL2.dll)
install_debug(openvr_api.dll)
install_release(openvr_api.dll)
install_debug(openvr_api.pdb)
diff --git a/CMake/Packages/FindSDL2.cmake b/CMake/Packages/FindSDL2.cmake
index 4b42a51..793eb71 100644
--- a/CMake/Packages/FindSDL2.cmake
+++ b/CMake/Packages/FindSDL2.cmake
@@ -182,7 +182,7 @@ ENDIF(SDL2_LIBRARY_TEMP)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
- REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
+ REQUIRED_VARS SDL2::SDL2 SDL2_INCLUDE_DIR)
if (WIN32)
set(SDL2_BIN_SEARCH_PATH ${OGRE_DEPENDENCIES_DIR}/bin ${CMAKE_SOURCE_DIR}/Dependencies/bin ${SDL2_HOME}/dll
@@ -201,6 +201,6 @@ IF(SDL2_STATIC)
if (UNIX AND NOT APPLE)
EXECUTE_PROCESS(COMMAND sdl2-config --static-libs OUTPUT_VARIABLE SDL2_LINK_FLAGS)
STRING(REGEX REPLACE "(\r?\n)+$" "" SDL2_LINK_FLAGS "${SDL2_LINK_FLAGS}")
- SET(SDL2_LIBRARY ${SDL2_LINK_FLAGS})
+ SET(SDL2::SDL2 ${SDL2_LINK_FLAGS})
ENDIF()
ENDIF(SDL2_STATIC)
diff --git a/Samples/2.0/Common/CMakeLists.txt b/Samples/2.0/Common/CMakeLists.txt
index b21601e..4ef90bd 100644
--- a/Samples/2.0/Common/CMakeLists.txt
+++ b/Samples/2.0/Common/CMakeLists.txt
@@ -49,4 +49,4 @@ add_library(${OGRE_SAMPLES_COMMON_LIBRARY} STATIC ${SOURCE_FILES} ${HEADER_FILES
link_directories(${CMAKE_CURRENT_BINARY_DIR})
-target_link_libraries(${OGRE_SAMPLES_COMMON_LIBRARY} ${SDL2_LIBRARY} OgreHlmsPbs OgreHlmsUnlit)
+target_link_libraries(${OGRE_SAMPLES_COMMON_LIBRARY} SDL2::SDL2 OgreHlmsPbs OgreHlmsUnlit)
diff --git a/Samples/2.0/Tutorials/EmptyProject/CMake/Dependencies/OGRE.cmake b/Samples/2.0/Tutorials/EmptyProject/CMake/Dependencies/OGRE.cmake
index 5e80709..3ba9b5a 100644
--- a/Samples/2.0/Tutorials/EmptyProject/CMake/Dependencies/OGRE.cmake
+++ b/Samples/2.0/Tutorials/EmptyProject/CMake/Dependencies/OGRE.cmake
@@ -224,13 +224,13 @@ endif()
if( NOT IOS )
set( CMAKE_PREFIX_PATH "${OGRE_SOURCE}/Dependencies ${CMAKE_PREFIX_PATH}" )
- find_package( SDL2 )
+ find_package(SDL2 CONFIG REQUIRED)
if( NOT SDL2_FOUND )
message( "Could not find SDL2. https://www.libsdl.org/" )
else()
message( STATUS "Found SDL2" )
include_directories( ${SDL2_INCLUDE_DIR} )
- set( OGRE_DEPENDENCY_LIBS ${OGRE_DEPENDENCY_LIBS} ${SDL2_LIBRARY} )
+ set( OGRE_DEPENDENCY_LIBS ${OGRE_DEPENDENCY_LIBS} SDL2::SDL2 )
endif()
endif()