Updating submodules
[hiphop-php.git] / CMake / FindLibiberty.cmake
blob32f9d54edbc6e83a22dbdf016bc30afe36b134ce
1 # Copyright (c) Facebook, Inc. and its affiliates.
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
7 #     http://www.apache.org/licenses/LICENSE-2.0
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.
15 find_path(LIBIBERTY_INCLUDE_DIR NAMES libiberty.h PATH_SUFFIXES libiberty)
16 mark_as_advanced(LIBIBERTY_INCLUDE_DIR)
18 find_library(LIBIBERTY_LIBRARY NAMES iberty)
19 mark_as_advanced(LIBIBERTY_LIBRARY)
21 include(FindPackageHandleStandardArgs)
22 FIND_PACKAGE_HANDLE_STANDARD_ARGS(
23   LIBIBERTY
24   REQUIRED_VARS LIBIBERTY_LIBRARY LIBIBERTY_INCLUDE_DIR)
26 if(LIBIBERTY_FOUND)
27   set(LIBIBERTY_LIBRARIES ${LIBIBERTY_LIBRARY})
28   set(LIBIBERTY_INCLUDE_DIRS ${LIBIBERTY_INCLUDE_DIR})
29 endif()