Skip to content

Commit c6b9a12

Browse files
mingtaoyfacebook-github-bot
authored andcommitted
Move FindZstd.cmake into fbcode_builder
Summary: A bunch of existing projects vendor it into their own CMake folder. But these same projects also have fbcode_builder's CMake directory in their CMAKE_MODULE_PATH, so move FindZstd here. Differential Revision: D29637686 fbshipit-source-id: 805676e18f98ef217dea8511d039edc38771b529
1 parent 01f0adb commit c6b9a12

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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)

0 commit comments

Comments
 (0)