From 1b633cceb5ddd527612117d77cd96d2edbc03faa Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Wed, 26 Nov 2014 09:02:22 +0200 Subject: [PATCH] Added a platform check cmake file for future platform checking. --- CMakeLists.txt | 4 ++++ CheckPlatform.cmake | 45 +++++++++++++++++++++++++++++++++++++++++++++ macros.cmake | 2 +- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 CheckPlatform.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 59a3cbcfd..d47c6f07b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 2.6) message(STATUS "CMake version: ${CMAKE_VERSION}") + include(macros.cmake) enable_testing() @@ -13,6 +14,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/") project(MaxScale) +#Disabled for now pending evaluation +#include(CheckPlatform.cmake) + check_deps() check_dirs() find_package(Valgrind) diff --git a/CheckPlatform.cmake b/CheckPlatform.cmake new file mode 100644 index 000000000..709b86db8 --- /dev/null +++ b/CheckPlatform.cmake @@ -0,0 +1,45 @@ +#Checks for all the C system headers found in all the files + + include(CheckFunctionExists) + include(CheckIncludeFiles) + + check_include_files(arpa/inet.h HAVE_ARPA_INET) + check_include_files(crypt.h HAVE_CRYPT) + check_include_files(ctype.h HAVE_CTYPE) + check_include_files(dirent.h HAVE_DIRENT) + check_include_files(dlfcn.h HAVE_DLFCN) + check_include_files(errno.h HAVE_ERRNO) + check_include_files(execinfo.h HAVE_EXECINFO) + check_include_files(fcntl.h HAVE_FCNTL) + check_include_files(ftw.h HAVE_FTW) + check_include_files(getopt.h HAVE_GETOPT) + check_include_files(ini.h HAVE_INI) + check_include_files(math.h HAVE_MATH) + check_include_files(memlog.h HAVE_MEMLOG) + check_include_files(netdb.h HAVE_NETDB) + check_include_files(netinet/in.h HAVE_NETINET_IN) + check_include_files(openssl/aes.h HAVE_OPENSSL_AES) + check_include_files(openssl/sha.h HAVE_OPENSSL_SHA) + check_include_files(pthread.h HAVE_PTHREAD) + check_include_files(pwd.h HAVE_PWD) + check_include_files(rdtsc.h HAVE_RDTSC) + check_include_files(regex.h HAVE_REGEX) + check_include_files(signal.h HAVE_SIGNAL) + check_include_files(stdarg.h HAVE_STDARG) + check_include_files(stdbool.h HAVE_STDBOOL) + check_include_files(stdint.h HAVE_STDINT) + check_include_files(stdio.h HAVE_STDIO) + check_include_files(stdlib.h HAVE_STDLIB) + check_include_files(string.h HAVE_STRING) + check_include_files(strings.h HAVE_STRINGS) + check_include_files(sys/epoll.h HAVE_SYS_EPOLL) + check_include_files(sys/ioctl.h HAVE_SYS_IOCTL) + check_include_files(syslog.h HAVE_SYSLOG) + check_include_files(sys/param.h HAVE_SYS_PARAM) + check_include_files(sys/socket.h HAVE_SYS_SOCKET) + check_include_files(sys/stat.h HAVE_SYS_STAT) + check_include_files(sys/time.h HAVE_SYS_TIME) + check_include_files(sys/types.h HAVE_SYS_TYPES) + check_include_files(sys/un.h HAVE_SYS_UN) + check_include_files(time.h HAVE_TIME) + check_include_files(unistd.h HAVE_UNISTD) diff --git a/macros.cmake b/macros.cmake index 09e0e8146..99c0001eb 100644 --- a/macros.cmake +++ b/macros.cmake @@ -21,7 +21,7 @@ macro(set_variables) set(INSTALL_DIR "/usr/local/skysql/maxscale/" CACHE PATH "MaxScale installation directory.") # Build type - set(BUILD_TYPE "None" CACHE STRING "Build type, possible values are:None, Debug, Optimized.") + set(BUILD_TYPE "None" CACHE STRING "Build type, possible values are:None, Debug, DebugSymbols, Optimized.") # hostname or IP address of MaxScale's host set(TEST_HOST "127.0.0.1" CACHE STRING "hostname or IP address of MaxScale's host")