blob: 12a50df910ddb4151c81cb8bac153480c447baf6 [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
James E. King, III7edc8fa2017-01-20 10:11:41 -050020include(CheckFunctionExists)
Pascal Bachd5f87e12014-12-12 15:59:17 +010021include(CheckIncludeFile)
22include(CheckIncludeFiles)
James E. King, III7edc8fa2017-01-20 10:11:41 -050023include(CheckSymbolExists)
Pascal Bachd5f87e12014-12-12 15:59:17 +010024
James E. King, III7edc8fa2017-01-20 10:11:41 -050025if (Inttypes_FOUND)
26 # This allows the inttypes.h and stdint.h checks to succeed on platforms that
27 # do not natively provide there.
28 set (CMAKE_REQUIRED_INCLUDES ${INTTYPES_INCLUDE_DIRS})
29endif ()
Pascal Bachd5f87e12014-12-12 15:59:17 +010030
31check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
32check_include_file(fcntl.h HAVE_FCNTL_H)
Jim King9de9b1f2015-04-30 16:03:34 -040033check_include_file(getopt.h HAVE_GETOPT_H)
Pascal Bachd5f87e12014-12-12 15:59:17 +010034check_include_file(inttypes.h HAVE_INTTYPES_H)
35check_include_file(netdb.h HAVE_NETDB_H)
36check_include_file(netinet/in.h HAVE_NETINET_IN_H)
37check_include_file(stdint.h HAVE_STDINT_H)
38check_include_file(unistd.h HAVE_UNISTD_H)
39check_include_file(pthread.h HAVE_PTHREAD_H)
40check_include_file(sys/time.h HAVE_SYS_TIME_H)
41check_include_file(sys/param.h HAVE_SYS_PARAM_H)
42check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H)
43check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
44check_include_file(sys/stat.h HAVE_SYS_STAT_H)
45check_include_file(sys/un.h HAVE_SYS_UN_H)
46check_include_file(sys/poll.h HAVE_SYS_POLL_H)
47check_include_file(sys/select.h HAVE_SYS_SELECT_H)
48check_include_file(sched.h HAVE_SCHED_H)
James E. King, III00d42522017-04-04 09:32:45 -040049check_include_file(string.h HAVE_STRING_H)
Pascal Bachd5f87e12014-12-12 15:59:17 +010050check_include_file(strings.h HAVE_STRINGS_H)
51
52check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
53check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
54check_function_exists(strerror_r HAVE_STRERROR_R)
55check_function_exists(sched_get_priority_max HAVE_SCHED_GET_PRIORITY_MAX)
56check_function_exists(sched_get_priority_min HAVE_SCHED_GET_PRIORITY_MIN)
57
58include(CheckCSourceCompiles)
59include(CheckCXXSourceCompiles)
60
61check_cxx_source_compiles(
62 "
63 #include <string.h>
64 int main(){char b;char *a = strerror_r(0, &b, 0); return(0);}
65 "
66 STRERROR_R_CHAR_P)
67
68
69set(PACKAGE ${PACKAGE_NAME})
70set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
71set(VERSION ${thrift_VERSION})
72
73# generate a config.h file
Roger Meier2e053162015-02-19 17:27:53 +010074configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/thrift/config.h")
James E. King, III7edc8fa2017-01-20 10:11:41 -050075
76include_directories("${CMAKE_CURRENT_BINARY_DIR}")