duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

DuckStationDependencies.cmake (2443B)


      1 # From PCSX2: On macOS, Mono.framework contains an ancient version of libpng. We don't want that.
      2 # Avoid it by telling cmake to avoid finding frameworks while we search for libpng.
      3 if(APPLE)
      4   set(FIND_FRAMEWORK_BACKUP ${CMAKE_FIND_FRAMEWORK})
      5   set(CMAKE_FIND_FRAMEWORK NEVER)
      6 endif()
      7 
      8 # Enable threads everywhere.
      9 set(THREADS_PREFER_PTHREAD_FLAG ON)
     10 find_package(Threads REQUIRED)
     11 
     12 find_package(SDL2 2.30.6 REQUIRED)
     13 find_package(Zstd 1.5.6 REQUIRED)
     14 find_package(WebP REQUIRED) # v1.4.0, spews an error on Linux because no pkg-config.
     15 find_package(ZLIB REQUIRED) # 1.3, but Mac currently doesn't use it.
     16 find_package(PNG 1.6.40 REQUIRED)
     17 find_package(JPEG REQUIRED)
     18 find_package(Freetype 2.13.2 REQUIRED) # 2.13.3, but flatpak is still on 2.13.2.
     19 find_package(lunasvg 2.4.1 REQUIRED)
     20 find_package(cpuinfo REQUIRED)
     21 find_package(DiscordRPC 3.4.0 REQUIRED)
     22 find_package(SoundTouch 2.3.3 REQUIRED)
     23 
     24 if(NOT WIN32)
     25   find_package(CURL REQUIRED)
     26 endif()
     27 
     28 if(ENABLE_X11)
     29   find_package(X11 REQUIRED)
     30   if (NOT X11_Xrandr_FOUND)
     31     message(FATAL_ERROR "XRandR extension is required")
     32   endif()
     33 endif()
     34 
     35 if(ENABLE_WAYLAND)
     36   find_package(ECM REQUIRED NO_MODULE)
     37   list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}")
     38   find_package(Wayland REQUIRED Egl)
     39 endif()
     40 
     41 if(ENABLE_VULKAN)
     42   find_package(Shaderc REQUIRED)
     43   find_package(spirv_cross_c_shared REQUIRED)
     44 
     45   if(LINUX)
     46     # We need to add the rpath for shaderc to the executable.
     47     get_target_property(SHADERC_LIBRARY Shaderc::shaderc_shared IMPORTED_LOCATION)
     48     get_filename_component(SHADERC_LIBRARY_DIRECTORY ${SHADERC_LIBRARY} DIRECTORY)
     49     list(APPEND CMAKE_BUILD_RPATH ${SHADERC_LIBRARY_DIRECTORY})
     50     get_target_property(SPIRV_CROSS_LIBRARY spirv-cross-c-shared IMPORTED_LOCATION)
     51     get_filename_component(SPIRV_CROSS_LIBRARY_DIRECTORY ${SPIRV_CROSS_LIBRARY} DIRECTORY)
     52     list(APPEND CMAKE_BUILD_RPATH ${SPIRV_CROSS_LIBRARY_DIRECTORY})
     53   endif()
     54 endif()
     55 
     56 if(LINUX)
     57   find_package(UDEV REQUIRED)
     58 endif()
     59 
     60 if(NOT WIN32 AND NOT APPLE)
     61   find_package(Libbacktrace REQUIRED)
     62 endif()
     63 
     64 if(NOT ANDROID AND NOT WIN32)
     65   find_package(FFMPEG COMPONENTS avcodec avformat avutil swresample swscale)
     66   if(NOT FFMPEG_FOUND)
     67     message(WARNING "FFmpeg not found, using bundled headers.")
     68   endif()
     69 endif()
     70 if(NOT ANDROID AND NOT FFMPEG_FOUND)
     71   set(FFMPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/dep/ffmpeg/include")
     72 endif()
     73 
     74 if(APPLE)
     75   set(CMAKE_FIND_FRAMEWORK ${FIND_FRAMEWORK_BACKUP})
     76 endif()