diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-01-31 11:43:22 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-02-03 15:01:53 +0000 |
commit | 4e7af2061e8c323b2a21f0549643a2cfab191664 (patch) | |
tree | 54c6046915aee4a91eb6178183c022b8e547d244 /cmake/FindZSTD.cmake | |
parent | 6251963ecd26bfc480b2871e26b6df4d7ab88cee (diff) | |
parent | 3f386095adc6c280008c7e811e88f0215f1d862f (diff) |
Merge remote-tracking branch 'origin/wip/cmake' into dev
This pulls the CMake port, which not only adds CMake files but also
modifies existing code. A brief summary of "seemingly unrelated" changes:
* configure.json was re-formatted to not use multi-line strings. That
is an extension of the Qt JSON parser but not JSON compliant, which
is needed for the configure.json-to-cmake conversion script (python).
* Some moc inclusions were added due to CMake's slightly different way
of handling moc. With the changes the files build with qmake and cmake.
* Since CMake just grep's for the Q_OBJECT macro to determine whether to
call moc (instead of doing pre-processing like qmake), the existing use
of "Q_OBJECT" in our documentation was changed to \Q_OBJECT, which cmake
doesn't see and which is now a qdoc macro.
* QTestLib's qFindTestData was extended to also search in the source
directory known at build time.
What this change also brings is a new way of building modules in Coin by using
YAML configuration files that describe the steps of building and testing in Coin
specific terms. The platform configuration files in qt5 are instructed to use the
old Coin built-in way of testing ("UseLegacyInstructions" feature) but for any
configurations that do not have this, these yaml files in the coin/ sub-directory
are used and shared across repositories.
Change-Id: I1d832c3400e8d6945ad787024ba60e7440225c08
Diffstat (limited to 'cmake/FindZSTD.cmake')
-rw-r--r-- | cmake/FindZSTD.cmake | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/cmake/FindZSTD.cmake b/cmake/FindZSTD.cmake new file mode 100644 index 0000000000..90d667dc29 --- /dev/null +++ b/cmake/FindZSTD.cmake @@ -0,0 +1,50 @@ +#.rst: +# FindZstd +# --------- +# +# Try to locate the Zstd library. +# If found, this will define the following variables: +# +# ``ZSTD_FOUND`` +# True if the zstd library is available +# ``ZSTD_INCLUDE_DIRS`` +# The zstd include directories +# ``ZSTD_LIBRARIES`` +# The zstd libraries for linking +# +# If ``ZSTD_FOUND`` is TRUE, it will also define the following +# imported target: +# +# ``ZSTD::ZSTD`` +# The zstd library + +find_package(PkgConfig) +pkg_check_modules(PC_ZSTD QUIET libzstd) + +find_path(ZSTD_INCLUDE_DIRS + NAMES zstd.h + HINTS ${PC_ZSTD_INCLUDEDIR} + PATH_SUFFIXES zstd) + +find_library(ZSTD_LIBRARIES + NAMES zstd zstd_static + HINTS ${PC_ZSTD_LIBDIR} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ZSTD DEFAULT_MSG ZSTD_LIBRARIES ZSTD_INCLUDE_DIRS) + +if(ZSTD_FOUND AND NOT TARGET ZSTD::ZSTD) + add_library(ZSTD::ZSTD UNKNOWN IMPORTED) + set_target_properties(ZSTD::ZSTD PROPERTIES + IMPORTED_LOCATION "${ZSTD_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIRS}") +endif() + +mark_as_advanced(ZSTD_INCLUDE_DIRS ZSTD_LIBRARIES) + +include(FeatureSummary) +set_package_properties(ZSTD PROPERTIES + URL "https://github.com/facebook/zstd" + DESCRIPTION "ZSTD compression library") + |