]>
Commit | Line | Data |
---|---|---|
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) | |
7 | find_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 | |
14 | find_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 | ||
20 | include(FindPackageHandleStandardArgs) | |
21 | find_package_handle_standard_args(thrift DEFAULT_MSG thrift_LIBRARIES | |
22 | thrift_INCLUDE_DIR) | |
23 | mark_as_advanced(thrift_LIBRARIES thrift_INCLUDE_DIR) | |
24 | ||
25 | if(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}) | |
31 | endif() |