diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 716256cd5..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) |
| @@ -254,7 +254,9 @@ if(ENABLE_QT) | |||
| 254 | 254 | ||
| 255 | # Check for system Qt on Linux, fallback to bundled Qt | 255 | # Check for system Qt on Linux, fallback to bundled Qt |
| 256 | if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | 256 | if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
| 257 | find_package(Qt5 ${QT_VERSION} COMPONENTS Widgets) | 257 | if (NOT YUZU_USE_BUNDLED_QT) |
| 258 | find_package(Qt5 ${QT_VERSION} COMPONENTS Widgets) | ||
| 259 | endif() | ||
| 258 | if (NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT) | 260 | if (NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT) |
| 259 | # Check for dependencies, then enable bundled Qt download | 261 | # Check for dependencies, then enable bundled Qt download |
| 260 | 262 | ||
| @@ -337,6 +339,8 @@ if(ENABLE_QT) | |||
| 337 | endif() | 339 | endif() |
| 338 | endif() | 340 | endif() |
| 339 | 341 | ||
| 342 | set(YUZU_QT_NO_CMAKE_SYSTEM_PATH) | ||
| 343 | |||
| 340 | # Workaround for an issue where conan tries to build Qt from scratch instead of download prebuilt binaries | 344 | # Workaround for an issue where conan tries to build Qt from scratch instead of download prebuilt binaries |
| 341 | set(QT_PREFIX_HINT) | 345 | set(QT_PREFIX_HINT) |
| 342 | 346 | ||
| @@ -354,8 +358,10 @@ if(ENABLE_QT) | |||
| 354 | endif() | 358 | endif() |
| 355 | 359 | ||
| 356 | set(QT_PREFIX_HINT HINTS "${QT_PREFIX}") | 360 | set(QT_PREFIX_HINT HINTS "${QT_PREFIX}") |
| 361 | |||
| 362 | set(YUZU_QT_NO_CMAKE_SYSTEM_PATH "NO_CMAKE_SYSTEM_PATH") | ||
| 357 | endif() | 363 | endif() |
| 358 | find_package(Qt5 ${QT_VERSION} REQUIRED COMPONENTS Widgets ${QT_PREFIX_HINT} NO_CMAKE_SYSTEM_PATH) | 364 | find_package(Qt5 ${QT_VERSION} REQUIRED COMPONENTS Widgets ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH}) |
| 359 | if (YUZU_USE_QT_WEB_ENGINE) | 365 | if (YUZU_USE_QT_WEB_ENGINE) |
| 360 | find_package(Qt5 COMPONENTS WebEngineCore WebEngineWidgets) | 366 | find_package(Qt5 COMPONENTS WebEngineCore WebEngineWidgets) |
| 361 | endif() | 367 | endif() |
| @@ -387,26 +393,20 @@ if (ENABLE_SDL2) | |||
| 387 | add_library(SDL2 INTERFACE) | 393 | add_library(SDL2 INTERFACE) |
| 388 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") | 394 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") |
| 389 | 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.") | ||
| 390 | else() | 398 | else() |
| 391 | if (YUZU_ALLOW_SYSTEM_SDL2) | 399 | find_package(SDL2 2.0.15 REQUIRED) |
| 392 | find_package(SDL2 2.0.15 QUIET) | ||
| 393 | |||
| 394 | if (SDL2_FOUND) | ||
| 395 | # Some installations don't set SDL2_LIBRARIES | ||
| 396 | if("${SDL2_LIBRARIES}" STREQUAL "") | ||
| 397 | message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") | ||
| 398 | set(SDL2_LIBRARIES "SDL2::SDL2") | ||
| 399 | endif() | ||
| 400 | 400 | ||
| 401 | include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) | 401 | # Some installations don't set SDL2_LIBRARIES |
| 402 | add_library(SDL2 INTERFACE) | 402 | if("${SDL2_LIBRARIES}" STREQUAL "") |
| 403 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") | 403 | message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") |
| 404 | else() | 404 | set(SDL2_LIBRARIES "SDL2::SDL2") |
| 405 | message(STATUS "SDL2 2.0.15 or newer not found, falling back to externals.") | ||
| 406 | endif() | ||
| 407 | else() | ||
| 408 | message(STATUS "Using SDL2 from externals.") | ||
| 409 | endif() | 405 | endif() |
| 406 | |||
| 407 | include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) | ||
| 408 | add_library(SDL2 INTERFACE) | ||
| 409 | target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") | ||
| 410 | endif() | 410 | endif() |
| 411 | endif() | 411 | endif() |
| 412 | 412 | ||