mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 18:00:17 +02:00
Much like the prior xxhash PR. This one also has the advantage of making
it completely trivial to handle distros that only install zy{dis,core}-config.cmake
and not the PkgConfig files (Gentoo, Arch)
Working on both Gentoo and Arch (CMake), and Fedora (PkgConfig). Does
work on Ubuntu 22.04 though it gets rejected due to being too old, since
we require 4.0 or newer.
Signed-off-by: crueter <crueter@eden-emu.dev>
24 lines
582 B
CMake
24 lines
582 B
CMake
# SPDX-License-Identifier: MIT
|
|
|
|
if (CMAKE_CROSSCOMPILING)
|
|
return()
|
|
endif()
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package(Zycore QUIET CONFIG)
|
|
|
|
if (Zycore_CONSIDERED_CONFIGS)
|
|
find_package_handle_standard_args(Zycore CONFIG_MODE)
|
|
else()
|
|
find_package(PkgConfig QUIET)
|
|
pkg_search_module(Zycore QUIET IMPORTED_TARGET zycore)
|
|
find_package_handle_standard_args(Zycore
|
|
REQUIRED_VARS zycore_LINK_LIBRARIES
|
|
VERSION_VAR zycore_VERSION)
|
|
|
|
if (TARGET PkgConfig::zycore)
|
|
add_library(Zycore::Zycore ALIAS PkgConfig::zycore)
|
|
endif()
|
|
endif()
|