aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-12-06 09:58:48 -0500
committerGitHub <noreply@github.com>2022-12-06 09:58:48 -0500
commita225ba4cda6a5e38af6cd7464d19754506152ec9 (patch)
tree3506ce99ec9730d6ae08e593c0c7a4979d9e8ce2 /CMakeLists.txt
parente86e144a7c3a6039f1262b53e6f56ccdb9ce3cc0 (diff)
parente6ae720c339f8ca97e0dbffe09f6c6b871bb82e0 (diff)
Merge pull request #9391 from abouvier/cmake-sdl
cmake: use sdl2 imported target
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 3 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a2bdee819..cd59e7485 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -432,23 +432,13 @@ if (ENABLE_SDL2)
set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library")
set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll")
- add_library(SDL2 INTERFACE)
- target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}")
- target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
+ add_library(SDL2::SDL2 INTERFACE IMPORTED)
+ target_link_libraries(SDL2::SDL2 INTERFACE "${SDL2_LIBRARY}")
+ target_include_directories(SDL2::SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
elseif (YUZU_USE_EXTERNAL_SDL2)
message(STATUS "Using SDL2 from externals.")
else()
find_package(SDL2 2.0.18 REQUIRED)
-
- # Some installations don't set SDL2_LIBRARIES
- if("${SDL2_LIBRARIES}" STREQUAL "")
- message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2")
- set(SDL2_LIBRARIES "SDL2::SDL2")
- endif()
-
- include_directories(SYSTEM ${SDL2_INCLUDE_DIRS})
- add_library(SDL2 INTERFACE)
- target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}")
endif()
endif()