blob: 8f370df6c1d7f524d0bc9d306cb7908b60e67f01 [file] [log] [blame]
Pascal Bachd5f87e12014-12-12 15:59:17 +01001#
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' Cohen12319302019-01-25 10:42:54 -050020macro(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
26
Pascal Bachd5f87e12014-12-12 15:59:17 +010027macro(ADD_LIBRARY_THRIFT name)
James E. King III278528c2019-01-11 12:17:44 -050028 add_library(${name} ${ARGN})
Pascal Bachd5f87e12014-12-12 15:59:17 +010029 set_target_properties(${name} PROPERTIES
James E. King III278528c2019-01-11 12:17:44 -050030 OUTPUT_NAME ${name}${THRIFT_RUNTIME_POSTFIX} # windows link variants (/MT, /MD, /MTd, /MDd) get different names
31 VERSION ${thrift_VERSION} )
32 # set_target_properties(${name} PROPERTIES PUBLIC_HEADER "${thriftcpp_HEADERS}")
Pascal Bachd5f87e12014-12-12 15:59:17 +010033 install(TARGETS ${name}
34 RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
35 LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
36 ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
37 PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}")
James E. King III278528c2019-01-11 12:17:44 -050038endmacro()
Pascal Bachd5f87e12014-12-12 15:59:17 +010039
Nobuaki Sukegawa11da87e2016-09-10 14:02:19 +090040macro(TARGET_INCLUDE_DIRECTORIES_THRIFT name)
Nobuaki Sukegawa11da87e2016-09-10 14:02:19 +090041 target_include_directories(${name} ${ARGN})
James E. King III278528c2019-01-11 12:17:44 -050042endmacro()
Nobuaki Sukegawa11da87e2016-09-10 14:02:19 +090043
Pascal Bachd5f87e12014-12-12 15:59:17 +010044macro(TARGET_LINK_LIBRARIES_THRIFT name)
Pascal Bachd5f87e12014-12-12 15:59:17 +010045 target_link_libraries(${name} ${ARGN})
James E. King III278528c2019-01-11 12:17:44 -050046endmacro()
Jim King9de9b1f2015-04-30 16:03:34 -040047
48macro(LINK_AGAINST_THRIFT_LIBRARY target libname)
Jim King9de9b1f2015-04-30 16:03:34 -040049 target_link_libraries(${target} ${libname})
James E. King III278528c2019-01-11 12:17:44 -050050endmacro()
Jim King9de9b1f2015-04-30 16:03:34 -040051
52macro(TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY target libname)
Nobuaki Sukegawa11da87e2016-09-10 14:02:19 +090053 target_link_libraries(${target} ${ARGN} ${libname})
James E. King III278528c2019-01-11 12:17:44 -050054endmacro()