diff options
| author | 2022-12-06 09:58:48 -0500 | |
|---|---|---|
| committer | 2022-12-06 09:58:48 -0500 | |
| commit | a225ba4cda6a5e38af6cd7464d19754506152ec9 (patch) | |
| tree | 3506ce99ec9730d6ae08e593c0c7a4979d9e8ce2 /CMakeLists.txt | |
| parent | Merge pull request #9387 from abouvier/cmake-libusb (diff) | |
| parent | cmake: use sdl2 imported target (diff) | |
| download | yuzu-a225ba4cda6a5e38af6cd7464d19754506152ec9.tar.gz yuzu-a225ba4cda6a5e38af6cd7464d19754506152ec9.tar.xz yuzu-a225ba4cda6a5e38af6cd7464d19754506152ec9.zip | |
Merge pull request #9391 from abouvier/cmake-sdl
cmake: use sdl2 imported target
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 16 |
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) | |||
| 432 | set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library") | 432 | set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library") |
| 433 | set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll") | 433 | set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll") |
| 434 | 434 | ||
| 435 | add_library(SDL2 INTERFACE) | 435 | add_library(SDL2::SDL2 INTERFACE IMPORTED) |
| 436 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") | 436 | target_link_libraries(SDL2::SDL2 INTERFACE "${SDL2_LIBRARY}") |
| 437 | target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") | 437 | target_include_directories(SDL2::SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") |
| 438 | elseif (YUZU_USE_EXTERNAL_SDL2) | 438 | elseif (YUZU_USE_EXTERNAL_SDL2) |
| 439 | message(STATUS "Using SDL2 from externals.") | 439 | message(STATUS "Using SDL2 from externals.") |
| 440 | else() | 440 | else() |
| 441 | find_package(SDL2 2.0.18 REQUIRED) | 441 | find_package(SDL2 2.0.18 REQUIRED) |
| 442 | |||
| 443 | # Some installations don't set SDL2_LIBRARIES | ||
| 444 | if("${SDL2_LIBRARIES}" STREQUAL "") | ||
| 445 | message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") | ||
| 446 | set(SDL2_LIBRARIES "SDL2::SDL2") | ||
| 447 | endif() | ||
| 448 | |||
| 449 | include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) | ||
| 450 | add_library(SDL2 INTERFACE) | ||
| 451 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") | ||
| 452 | endif() | 442 | endif() |
| 453 | endif() | 443 | endif() |
| 454 | 444 | ||