]> git.proxmox.com Git - ceph.git/blame - ceph/cmake/modules/Findthrift.cmake
import ceph quincy 17.2.1
[ceph.git] / ceph / cmake / modules / Findthrift.cmake
CommitLineData
20effc67
TL
1# This module defines thrift_LIBRARIES, libraries to link thrift_INCLUDE_DIR,
2# where to find thrift headers thrift_COMPILER, thrift compiler executable
3# thrift_FOUND, If false, do not try to use it.
4
5# prefer the thrift version supplied in thrift_HOME (cmake -Dthrift_HOME then
6# environment)
7find_path(
8 thrift_INCLUDE_DIR
9 NAMES thrift/Thrift.h
10 HINTS ${thrift_HOME} ENV thrift_HOME /usr/local /opt/local
11 PATH_SUFFIXES include)
12
13# prefer the thrift version supplied in thrift_HOME
14find_library(
15 thrift_LIBRARIES
16 NAMES thrift libthrift
17 HINTS ${thrift_HOME} ENV thrift_HOME /usr/local /opt/local
18 PATH_SUFFIXES lib lib64)
19
20include(FindPackageHandleStandardArgs)
21find_package_handle_standard_args(thrift DEFAULT_MSG thrift_LIBRARIES
22 thrift_INCLUDE_DIR)
23mark_as_advanced(thrift_LIBRARIES thrift_INCLUDE_DIR)
24
25if(thrift_FOUND AND NOT (TARGET thrift::libthrift))
26 add_library(thrift::libthrift UNKNOWN IMPORTED)
27 set_target_properties(
28 thrift::libthrift
29 PROPERTIES IMPORTED_LOCATION ${thrift_LIBRARIES}
30 INTERFACE_INCLUDE_DIRECTORIES ${thrift_INCLUDE_DIR})
31endif()