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 | |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 20 | macro(ADD_LIBRARY_THRIFT name) |
James E. King III | 278528c | 2019-01-11 12:17:44 -0500 | [diff] [blame] | 21 | add_library(${name} ${ARGN}) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 22 | set_target_properties(${name} PROPERTIES |
James E. King III | 278528c | 2019-01-11 12:17:44 -0500 | [diff] [blame] | 23 | OUTPUT_NAME ${name}${THRIFT_RUNTIME_POSTFIX} # windows link variants (/MT, /MD, /MTd, /MDd) get different names |
| 24 | VERSION ${thrift_VERSION} ) |
| 25 | # set_target_properties(${name} PROPERTIES PUBLIC_HEADER "${thriftcpp_HEADERS}") |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 26 | install(TARGETS ${name} |
| 27 | RUNTIME DESTINATION "${BIN_INSTALL_DIR}" |
| 28 | LIBRARY DESTINATION "${LIB_INSTALL_DIR}" |
| 29 | ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" |
| 30 | PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}") |
James E. King III | 278528c | 2019-01-11 12:17:44 -0500 | [diff] [blame] | 31 | endmacro() |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 32 | |
Nobuaki Sukegawa | 11da87e | 2016-09-10 14:02:19 +0900 | [diff] [blame] | 33 | macro(TARGET_INCLUDE_DIRECTORIES_THRIFT name) |
Nobuaki Sukegawa | 11da87e | 2016-09-10 14:02:19 +0900 | [diff] [blame] | 34 | target_include_directories(${name} ${ARGN}) |
James E. King III | 278528c | 2019-01-11 12:17:44 -0500 | [diff] [blame] | 35 | endmacro() |
Nobuaki Sukegawa | 11da87e | 2016-09-10 14:02:19 +0900 | [diff] [blame] | 36 | |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 37 | macro(TARGET_LINK_LIBRARIES_THRIFT name) |
Pascal Bach | d5f87e1 | 2014-12-12 15:59:17 +0100 | [diff] [blame] | 38 | target_link_libraries(${name} ${ARGN}) |
James E. King III | 278528c | 2019-01-11 12:17:44 -0500 | [diff] [blame] | 39 | endmacro() |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 40 | |
| 41 | macro(LINK_AGAINST_THRIFT_LIBRARY target libname) |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 42 | target_link_libraries(${target} ${libname}) |
James E. King III | 278528c | 2019-01-11 12:17:44 -0500 | [diff] [blame] | 43 | endmacro() |
Jim King | 9de9b1f | 2015-04-30 16:03:34 -0400 | [diff] [blame] | 44 | |
| 45 | macro(TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY target libname) |
Nobuaki Sukegawa | 11da87e | 2016-09-10 14:02:19 +0900 | [diff] [blame] | 46 | target_link_libraries(${target} ${ARGN} ${libname}) |
James E. King III | 278528c | 2019-01-11 12:17:44 -0500 | [diff] [blame] | 47 | endmacro() |