diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index de93ca2c2..857550e71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -13,7 +13,7 @@ project(yuzu) | |||
| 13 | option(ENABLE_SDL2 "Enable the SDL2 frontend" ON) | 13 | option(ENABLE_SDL2 "Enable the SDL2 frontend" ON) |
| 14 | CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" ON "ENABLE_SDL2;MSVC" OFF) | 14 | CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" ON "ENABLE_SDL2;MSVC" OFF) |
| 15 | # On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion | 15 | # On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion |
| 16 | option(YUZU_ALLOW_SYSTEM_SDL2 "Try using system SDL2 before fallling back to one from externals" OFF) | 16 | CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF) |
| 17 | 17 | ||
| 18 | option(ENABLE_QT "Enable the Qt frontend" ON) | 18 | option(ENABLE_QT "Enable the Qt frontend" ON) |
| 19 | option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF) | 19 | option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF) |
| @@ -393,26 +393,20 @@ if (ENABLE_SDL2) | |||
| 393 | add_library(SDL2 INTERFACE) | 393 | add_library(SDL2 INTERFACE) |
| 394 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") | 394 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") |
| 395 | target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") | 395 | target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") |
| 396 | elseif (YUZU_USE_EXTERNAL_SDL2) | ||
| 397 | message(STATUS "Using SDL2 from externals.") | ||
| 396 | else() | 398 | else() |
| 397 | if (YUZU_ALLOW_SYSTEM_SDL2) | 399 | find_package(SDL2 2.0.15 REQUIRED) |
| 398 | find_package(SDL2 2.0.15 QUIET) | ||
| 399 | |||
| 400 | if (SDL2_FOUND) | ||
| 401 | # Some installations don't set SDL2_LIBRARIES | ||
| 402 | if("${SDL2_LIBRARIES}" STREQUAL "") | ||
| 403 | message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") | ||
| 404 | set(SDL2_LIBRARIES "SDL2::SDL2") | ||
| 405 | endif() | ||
| 406 | 400 | ||
| 407 | include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) | 401 | # Some installations don't set SDL2_LIBRARIES |
| 408 | add_library(SDL2 INTERFACE) | 402 | if("${SDL2_LIBRARIES}" STREQUAL "") |
| 409 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") | 403 | message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") |
| 410 | else() | 404 | set(SDL2_LIBRARIES "SDL2::SDL2") |
| 411 | message(STATUS "SDL2 2.0.15 or newer not found, falling back to externals.") | ||
| 412 | endif() | ||
| 413 | else() | ||
| 414 | message(STATUS "Using SDL2 from externals.") | ||
| 415 | endif() | 405 | endif() |
| 406 | |||
| 407 | include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) | ||
| 408 | add_library(SDL2 INTERFACE) | ||
| 409 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") | ||
| 416 | endif() | 410 | endif() |
| 417 | endif() | 411 | endif() |
| 418 | 412 | ||