2024-04-20 10:26:53 +00:00
|
|
|
# From PCSX2: On macOS, Mono.framework contains an ancient version of libpng. We don't want that.
|
|
|
|
# Avoid it by telling cmake to avoid finding frameworks while we search for libpng.
|
|
|
|
if(APPLE)
|
|
|
|
set(FIND_FRAMEWORK_BACKUP ${CMAKE_FIND_FRAMEWORK})
|
|
|
|
set(CMAKE_FIND_FRAMEWORK NEVER)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Enable threads everywhere.
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
2024-03-06 06:16:50 +00:00
|
|
|
|
2024-10-20 03:37:45 +00:00
|
|
|
find_package(SDL2 2.30.8 REQUIRED)
|
2024-06-23 01:36:24 +00:00
|
|
|
find_package(Zstd 1.5.6 REQUIRED)
|
|
|
|
find_package(WebP REQUIRED) # v1.4.0, spews an error on Linux because no pkg-config.
|
2024-04-20 10:26:53 +00:00
|
|
|
find_package(ZLIB REQUIRED) # 1.3, but Mac currently doesn't use it.
|
|
|
|
find_package(PNG 1.6.40 REQUIRED)
|
2024-08-25 10:53:25 +00:00
|
|
|
find_package(JPEG REQUIRED)
|
|
|
|
find_package(Freetype 2.13.2 REQUIRED) # 2.13.3, but flatpak is still on 2.13.2.
|
2024-08-25 04:39:59 +00:00
|
|
|
find_package(lunasvg 2.4.1 REQUIRED)
|
2024-07-02 08:13:42 +00:00
|
|
|
find_package(cpuinfo REQUIRED)
|
2024-07-04 04:23:11 +00:00
|
|
|
find_package(DiscordRPC 3.4.0 REQUIRED)
|
2024-08-02 10:53:35 +00:00
|
|
|
find_package(SoundTouch 2.3.3 REQUIRED)
|
2024-11-05 02:09:48 +00:00
|
|
|
find_package(libzip 1.11.1 REQUIRED)
|
2024-04-20 10:26:53 +00:00
|
|
|
|
|
|
|
if(NOT WIN32)
|
2024-03-06 06:16:50 +00:00
|
|
|
find_package(CURL REQUIRED)
|
2024-04-20 10:26:53 +00:00
|
|
|
endif()
|
2024-04-05 05:28:33 +00:00
|
|
|
|
2024-04-20 10:26:53 +00:00
|
|
|
if(ENABLE_X11)
|
|
|
|
find_package(X11 REQUIRED)
|
2024-11-11 10:12:26 +00:00
|
|
|
if (NOT X11_xcb_FOUND OR NOT X11_xcb_randr_FOUND OR NOT X11_X11_xcb_FOUND)
|
|
|
|
message(FATAL_ERROR "XCB, XCB-randr and X11-xcb are required")
|
2024-04-05 05:28:33 +00:00
|
|
|
endif()
|
2024-04-20 10:26:53 +00:00
|
|
|
endif()
|
2024-04-05 05:28:33 +00:00
|
|
|
|
2024-04-25 05:04:40 +00:00
|
|
|
if(ENABLE_WAYLAND)
|
|
|
|
find_package(ECM REQUIRED NO_MODULE)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}")
|
|
|
|
find_package(Wayland REQUIRED Egl)
|
|
|
|
endif()
|
|
|
|
|
2024-10-20 03:37:45 +00:00
|
|
|
if(BUILD_QT_FRONTEND)
|
2024-11-05 02:09:48 +00:00
|
|
|
find_package(Qt6 6.8.0 COMPONENTS Core Gui Widgets LinguistTools REQUIRED)
|
2024-10-20 03:37:45 +00:00
|
|
|
endif()
|
|
|
|
|
2024-10-19 03:10:19 +00:00
|
|
|
find_package(Shaderc REQUIRED)
|
|
|
|
find_package(spirv_cross_c_shared REQUIRED)
|
2024-05-12 12:56:58 +00:00
|
|
|
|
2024-10-19 03:10:19 +00:00
|
|
|
if(LINUX AND NOT (ALLOW_INSTALL AND INSTALL_SELF_CONTAINED))
|
|
|
|
# We need to add the rpath for shaderc to the executable.
|
|
|
|
get_target_property(SHADERC_LIBRARY Shaderc::shaderc_shared IMPORTED_LOCATION)
|
|
|
|
get_filename_component(SHADERC_LIBRARY_DIRECTORY ${SHADERC_LIBRARY} DIRECTORY)
|
|
|
|
list(APPEND CMAKE_BUILD_RPATH ${SHADERC_LIBRARY_DIRECTORY})
|
|
|
|
get_target_property(SPIRV_CROSS_LIBRARY spirv-cross-c-shared IMPORTED_LOCATION)
|
|
|
|
get_filename_component(SPIRV_CROSS_LIBRARY_DIRECTORY ${SPIRV_CROSS_LIBRARY} DIRECTORY)
|
|
|
|
list(APPEND CMAKE_BUILD_RPATH ${SPIRV_CROSS_LIBRARY_DIRECTORY})
|
2024-04-20 10:26:53 +00:00
|
|
|
endif()
|
2024-04-14 06:24:12 +00:00
|
|
|
|
2024-04-20 10:26:53 +00:00
|
|
|
if(LINUX)
|
2024-02-29 14:50:31 +00:00
|
|
|
find_package(UDEV REQUIRED)
|
|
|
|
endif()
|
2024-04-20 10:26:53 +00:00
|
|
|
|
|
|
|
if(NOT WIN32 AND NOT APPLE)
|
2024-05-25 06:49:24 +00:00
|
|
|
find_package(Libbacktrace REQUIRED)
|
2024-02-03 07:12:40 +00:00
|
|
|
endif()
|
2024-04-20 10:26:53 +00:00
|
|
|
|
2024-08-12 03:26:43 +00:00
|
|
|
if(NOT ANDROID AND NOT WIN32)
|
|
|
|
find_package(FFMPEG COMPONENTS avcodec avformat avutil swresample swscale)
|
|
|
|
if(NOT FFMPEG_FOUND)
|
|
|
|
message(WARNING "FFmpeg not found, using bundled headers.")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
if(NOT ANDROID AND NOT FFMPEG_FOUND)
|
|
|
|
set(FFMPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/dep/ffmpeg/include")
|
|
|
|
endif()
|
|
|
|
|
2024-04-20 10:26:53 +00:00
|
|
|
if(APPLE)
|
|
|
|
set(CMAKE_FIND_FRAMEWORK ${FIND_FRAMEWORK_BACKUP})
|
|
|
|
endif()
|