Warning, /acts/cmake/FindZSTD.cmake is written in an unsupported language. File is not indexed.
0001 # Copyright (c) Meta Platforms, Inc. and affiliates.
0002 #
0003 # Licensed under the Apache License, Version 2.0 (the "License");
0004 # you may not use this file except in compliance with the License.
0005 # You may obtain a copy of the License at
0006 #
0007 # http://www.apache.org/licenses/LICENSE-2.0
0008 #
0009 # Unless required by applicable law or agreed to in writing, software
0010 # distributed under the License is distributed on an "AS IS" BASIS,
0011 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0012 # See the License for the specific language governing permissions and
0013 # limitations under the License.
0014
0015 # Originally taken from https://github.com/facebook/folly/blob/main/CMake/FindZstd.cmake
0016
0017 #
0018 # - Try to find Facebook zstd library
0019 # This will define
0020 # ZSTD_FOUND
0021 # ZSTD_INCLUDE_DIR
0022 # ZSTD_LIBRARY
0023 #
0024
0025 find_path(ZSTD_INCLUDE_DIR NAMES zstd.h)
0026
0027 find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd zstd_staticd)
0028 find_library(ZSTD_LIBRARY_RELEASE NAMES zstd zstd_static)
0029
0030 include(SelectLibraryConfigurations)
0031 select_library_configurations(ZSTD)
0032
0033 include(FindPackageHandleStandardArgs)
0034 find_package_handle_standard_args(
0035 ZSTD
0036 DEFAULT_MSG
0037 ZSTD_LIBRARY
0038 ZSTD_INCLUDE_DIR
0039 )
0040
0041 if(ZSTD_FOUND)
0042 add_library(ZSTD UNKNOWN IMPORTED)
0043 set_target_properties(ZSTD PROPERTIES IMPORTED_LOCATION ${ZSTD_LIBRARY})
0044 target_include_directories(ZSTD INTERFACE ${ZSTD_INCLUDE_DIR})
0045 add_library(ZSTD::ZSTD ALIAS ZSTD)
0046 endif()
0047
0048 mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)