mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-12 06:00:39 +02:00
Port of #5159 Find modules are preferred for pkgconfig/otherwise non-CMake libraries. Let's use that here for xxHash. Signed-off-by: crueter <crueter@eden-emu.dev>
19 lines
504 B
CMake
19 lines
504 B
CMake
# SPDX-License-Identifier: MIT
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package(PkgConfig QUIET)
|
|
pkg_search_module(xxhash QUIET IMPORTED_TARGET xxhash libxxhash)
|
|
find_package_handle_standard_args(xxhash
|
|
REQUIRED_VARS xxhash_LINK_LIBRARIES
|
|
VERSION_VAR xxhash_VERSION
|
|
)
|
|
|
|
if (xxhash_FOUND AND NOT TARGET xxHash::xxhash)
|
|
if (TARGET PkgConfig::xxhash)
|
|
add_library(xxHash::xxhash ALIAS PkgConfig::xxhash)
|
|
else()
|
|
add_library(xxHash::xxhash ALIAS xxhash)
|
|
endif()
|
|
endif()
|