Debian Codegraph @

thirdparty/folly/build/fbcode_builder/CMake/FindZstd.cmake

raw
1 # Copyright (c) Facebook, Inc. and its affiliates.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 #
16 # - Try to find Facebook zstd library
17 # This will define
18 # ZSTD_FOUND
19 # ZSTD_INCLUDE_DIR
20 # ZSTD_LIBRARY
21 #
22
23 find_path(ZSTD_INCLUDE_DIR NAMES zstd.h)
24
25 find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd zstd_staticd)
26 find_library(ZSTD_LIBRARY_RELEASE NAMES zstd zstd_static)
27
28 include(SelectLibraryConfigurations)
29 SELECT_LIBRARY_CONFIGURATIONS(ZSTD)
30
31 include(FindPackageHandleStandardArgs)
32 FIND_PACKAGE_HANDLE_STANDARD_ARGS(
33 ZSTD DEFAULT_MSG
34 ZSTD_LIBRARY ZSTD_INCLUDE_DIR
35 )
36
37 if (ZSTD_FOUND)
38 message(STATUS "Found Zstd: ${ZSTD_LIBRARY}")
39 endif()
40
41 mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)