Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
Joel 'Aaron' Cohen | 1231930 | 2019-01-25 10:42:54 -0500 | [diff] [blame] | 20 | macro(ADD_PKGCONFIG_THRIFT name) |
| 21 | configure_file("${name}.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/${name}.pc" @ONLY) |
| 22 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}.pc" |
| 23 | DESTINATION "${PKGCONFIG_INSTALL_DIR}") |
| 24 | endmacro(ADD_PKGCONFIG_THRIFT) |
| 25 | |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 26 | macro(ADD_LIBRARY_THRIFT name) |
James E. King III | 278528c | 2019-01-11 12:17:44 -0500 | [diff] [blame] | 27 | add_library(${name} ${ARGN}) |
Jens Geyer | baddaa8 | 2020-02-05 22:30:01 +0100 | [diff] [blame] | 28 | target_include_directories(${name} INTERFACE $<INSTALL_INTERFACE:include>) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 29 | set_target_properties(${name} PROPERTIES |
James E. King III | 278528c | 2019-01-11 12:17:44 -0500 | [diff] [blame] | 30 | OUTPUT_NAME ${name}${THRIFT_RUNTIME_POSTFIX} # windows link variants (/MT, /MD, /MTd, /MDd) get different names |
Mario Emmenlauer | bdb54bc | 2021-08-31 14:00:16 +0200 | [diff] [blame] | 31 | VERSION ${thrift_VERSION}) |
| 32 | |
James E. King III | 278528c | 2019-01-11 12:17:44 -0500 | [diff] [blame] | 33 | # set_target_properties(${name} PROPERTIES PUBLIC_HEADER "${thriftcpp_HEADERS}") |
soroshsabz | 0c4e96f | 2019-03-15 15:05:18 +0330 | [diff] [blame] | 34 | install(TARGETS ${name} EXPORT "${name}Targets" |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 35 | RUNTIME DESTINATION "${BIN_INSTALL_DIR}" |
| 36 | LIBRARY DESTINATION "${LIB_INSTALL_DIR}" |
| 37 | ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" |
| 38 | PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}") |
soroshsabz | 0c4e96f | 2019-03-15 15:05:18 +0330 | [diff] [blame] | 39 | |
| 40 | export(EXPORT "${name}Targets" |
| 41 | FILE "${CMAKE_CURRENT_BINARY_DIR}/${name}/${name}Targets.cmake" |
| 42 | NAMESPACE "${name}::") |
| 43 | |
| 44 | install(EXPORT "${name}Targets" |
| 45 | FILE "${name}Targets.cmake" |
| 46 | NAMESPACE "${name}::" |
| 47 | DESTINATION "${CMAKE_INSTALL_DIR}/thrift") |
Mario Emmenlauer | bdb54bc | 2021-08-31 14:00:16 +0200 | [diff] [blame] | 48 | endmacro() |