]> git.proxmox.com Git - ceph.git/blame - ceph/src/jaegertracing/thrift/build/cmake/ThriftMacros.cmake
buildsys: switch source download to quincy
[ceph.git] / ceph / src / jaegertracing / thrift / build / cmake / ThriftMacros.cmake
CommitLineData
f67539c2
TL
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
20macro(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}")
24endmacro(ADD_PKGCONFIG_THRIFT)
25
26macro(ADD_LIBRARY_THRIFT name)
27 add_library(${name} ${ARGN})
28 set_target_properties(${name} PROPERTIES
29 OUTPUT_NAME ${name}${THRIFT_RUNTIME_POSTFIX} # windows link variants (/MT, /MD, /MTd, /MDd) get different names
30 VERSION ${thrift_VERSION} )
31 # set_target_properties(${name} PROPERTIES PUBLIC_HEADER "${thriftcpp_HEADERS}")
32 install(TARGETS ${name} EXPORT "${name}Targets"
33 RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
34 LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
35 ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
36 PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}")
37
38 export(EXPORT "${name}Targets"
39 FILE "${CMAKE_CURRENT_BINARY_DIR}/${name}/${name}Targets.cmake"
40 NAMESPACE "${name}::")
41
42 install(EXPORT "${name}Targets"
43 FILE "${name}Targets.cmake"
44 NAMESPACE "${name}::"
45 DESTINATION "${CMAKE_INSTALL_DIR}/thrift")
46endmacro()
47
48macro(TARGET_INCLUDE_DIRECTORIES_THRIFT name)
49 target_include_directories(${name} ${ARGN})
50endmacro()
51
52macro(TARGET_LINK_LIBRARIES_THRIFT name)
53 target_link_libraries(${name} ${ARGN})
54endmacro()
55
56macro(LINK_AGAINST_THRIFT_LIBRARY target libname)
57 target_link_libraries(${target} ${libname})
58endmacro()
59
60macro(TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY target libname)
61 target_link_libraries(${target} ${ARGN} ${libname})
62endmacro()