yuzu/externals/find-modules/Findzstd.cmake
James Rowe bc30a591ba
Replace externals with Conan (#3735)
* Remove git submodules that will be loaded through conan

* Move custom Find modules to their own folder

* Use conan for downloading missing external dependencies

* CI: Change the yuzu source folder user to the user that the containers run on

* Attempt to remove dirty mingw build hack

* Install conan on the msvc build

* Only set release build type when using not using multi config generator

* Re-add qt bundled to workaround an issue with conan qt not downloading prebuilt binaries

* Add workaround for submodules that use legacy CMAKE variables

* Re-add USE_BUNDLED_QT on the msvc build bot
2020-05-08 17:09:29 -04:00

42 lines
916 B
CMake

find_package(PkgConfig QUIET)
pkg_check_modules(PC_zstd QUIET libzstd)
find_path(zstd_INCLUDE_DIR
NAMES zstd.h
PATHS ${PC_zstd_INCLUDE_DIRS}
)
find_library(zstd_LIBRARY
NAMES zstd
PATHS ${PC_zstd_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(zstd
FOUND_VAR zstd_FOUND
REQUIRED_VARS
zstd_LIBRARY
zstd_INCLUDE_DIR
VERSION_VAR zstd_VERSION
)
if(zstd_FOUND)
set(zstd_LIBRARIES ${zstd_LIBRARY})
set(zstd_INCLUDE_DIRS ${zstd_INCLUDE_DIR})
set(zstd_DEFINITIONS ${PC_zstd_CFLAGS_OTHER})
endif()
if(zstd_FOUND AND NOT TARGET zstd::zstd)
add_library(zstd::zstd UNKNOWN IMPORTED)
set_target_properties(zstd::zstd PROPERTIES
IMPORTED_LOCATION "${zstd_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PC_zstd_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}"
)
endif()
mark_as_advanced(
zstd_INCLUDE_DIR
zstd_LIBRARY
)