cmake support: first cut from David Vaz work.i

This commit is contained in:
Vitor Santos Costa
2014-12-04 07:59:30 +00:00
parent 9f28f7e836
commit ff977fbad8
58 changed files with 4486 additions and 47 deletions

View File

@@ -0,0 +1,39 @@
# AWI, downloaded from KDE repository since has not yet been transferred
# to cmake repository as of 2006-07-31.
# http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/CheckPrototypeExists.cmake?rev=505849&view=markup
#
# - Check if the prototype for a function exists.
# CHECK_PROTOTYPE_EXISTS (FUNCTION HEADER VARIABLE)
#
# FUNCTION - the name of the function you are looking for
# HEADER - the header(s) where the prototype should be declared
# VARIABLE - variable to store the result
#
# AWI further change from C++ to C since that is the core PLplot language.
INCLUDE(CheckCSourceCompiles)
MACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
SET(_INCLUDE_FILES)
FOREACH(it ${_HEADER})
SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
ENDFOREACH(it)
SET(_CHECK_PROTO_EXISTS_SOURCE_CODE "
${_INCLUDE_FILES}
void cmakeRequireSymbol(int dummy,...){(void)dummy;}
int main()
{
#ifndef ${_SYMBOL}
#ifndef _MSC_VER
cmakeRequireSymbol(0,&${_SYMBOL});
#else
char i = sizeof(&${_SYMBOL});
#endif
#endif
return 0;
}
")
CHECK_C_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
ENDMACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)

324
cmake/Config.cmake Normal file
View File

@@ -0,0 +1,324 @@
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
include(CheckLibraryExists)
include(CheckSymbolExists)
include(CheckFunctionExists)
include(CheckTypeSize)
include(CheckCXXSourceCompiles)
include(TestBigEndian)
# Test signal handler return type (mimics AC_TYPE_SIGNAL)
include(TestSignalType) #check if this is really needed as c89 defines this as void
# Test standard headers (mimics AC_HEADER_STDC)
include(TestSTDC)
check_include_file( alloca.h HAVE_ALLOCA_H )
check_include_file( direct.h HAVE_DIRECT_H )
check_include_file( dirent.h HAVE_DIRENT_H )
check_include_file( dlfcn.h HAVE_DLFCN_H )
check_include_file( errno.h HAVE_ERRNO_H )
check_include_file( execinfo.h HAVE_EXECINFO_H )
check_include_file( fcntl.h HAVE_FCNTL_H )
check_include_file( fenv.h HAVE_FENV_H )
check_include_file( fpu_control.h HAVE_FPU_CONTROL_H )
check_include_file( ieeefp.h HAVE_IEEEFP_H )
check_include_file( inttypes.h HAVE_INTTYPES_H )
check_include_file( io.h HAVE_IO_H )
check_include_file( Judy.h HAVE_JUDY_H)
check_include_file( LibLoaderAPI.h HAVE_LIBLOADERAPI_H )
check_include_file( limits.h HAVE_LIMITS_H )
check_include_file( locale.h HAVE_LOCALE_H )
check_include_file( mach-o/dyld.h HAVE_MACH_O_DYLD_H )
check_include_file( malloc.h HAVE_MALLOC_H )
check_include_file( math.h HAVE_MATH_H )
check_include_file( memory.h HAVE_MEMORY_H )
check_include_file( mpe.h HAVE_MPE_H )
check_include_file( mpi.h HAVE_MPI_H )
check_include_file( mysql/mysql.h HAVE_MYSQL_MYSQL_H )
check_include_file( netdb.h HAVE_NETDB_H )
check_include_file( netinet/in.h HAVE_NETINET_IN_H )
check_include_file( netinet/tcp.h HAVE_NETINET_TCP_H )
check_include_file( pthread.h HAVE_PTHREAD_H )
check_include_file( pwd.h HAVE_PWD_H )
check_include_file( regex.h HAVE_REGEX_H )
check_include_file( setjmp.h HAVE_SETJMP_H )
check_include_file( shlobj.h HAVE_SHLOBJ_H )
check_include_file( siginfo.h HAVE_SIGINFO_H )
check_include_file( signal.h HAVE_SIGNAL_H )
check_include_file( sqlite3.h HAVE_SQLITE3_H )
check_include_file( sql.h HAVE_SQL_H )
check_include_file( stdbool.h HAVE_STDBOOL_H )
check_include_file( stdint.h HAVE_STDINT_H )
check_include_file( strings.h HAVE_STRINGS_H )
check_include_file( stropts.h HAVE_STROPTS_H )
check_include_file( syslog.h HAVE_SYSLOG_H )
check_include_file( sys/conf.h HAVE_SYS_CONF_H )
check_include_file( sys/dir.h HAVE_SYS_DIR_H )
check_include_file( sys/file.h HAVE_SYS_FILE_H )
check_include_file( sys/mman.h HAVE_SYS_MMAN_H )
check_include_file( sys/ndir.h HAVE_SYS_NDIR_H )
check_include_file( sys/param.h HAVE_SYS_PARAM_H )
check_include_file( sys/resource.h HAVE_SYS_RESOURCE_H )
check_include_file( sys/select.h HAVE_SYS_SELECT_H )
check_include_file( sys/shm.h HAVE_SYS_SHM_H )
check_include_file( sys/socket.h HAVE_SYS_SOCKET_H )
check_include_file( sys/stat.h HAVE_SYS_STAT_H )
check_include_file( sys/times.h HAVE_SYS_TIMES_H )
check_include_file( sys/time.h HAVE_SYS_TIME_H )
check_include_file( sys/types.h HAVE_SYS_TYPES_H )
check_include_file( sys/ucontext.h HAVE_SYS_UCONTEXT_H )
check_include_file( sys/un.h HAVE_SYS_UN_H )
check_include_file( sys/wait.h HAVE_SYS_WAIT_H )
check_include_file( time.h HAVE_TIME_H )
check_include_file( ucontext.h HAVE_UCONTEXT_H )
check_include_file( unistd.h HAVE_UNISTD_H )
check_include_file( util.h HAVE_UTIL_H )
check_include_file( utime.h HAVE_UTIME_H )
check_include_file( wchar.h HAVE_WCHAR_H )
check_include_file( wctype.h HAVE_WCTYPE_H )
check_include_file( windef.h HAVE_WINDEF_H )
check_include_file( windows.h HAVE_WINDOWS_H )
check_include_file( winsock2.h HAVE_WINSOCK2_H )
check_include_file( winsock.h HAVE_WINSOCK_H )
check_type_size( "short int" SIZEOF_SHORT_INT )
check_type_size( "int" SIZEOF_INT )
check_type_size( "long int" SIZEOF_LONG )
check_type_size( "long int" SIZEOF_LONG_INT )
check_type_size( "long long int" SIZEOF_LONG_LONG )
check_type_size( "long long int" SIZEOF_LONG_LONG_INT )
check_type_size( "float" SIZEOF_FLOAT )
check_type_size( "double" SIZEOF_DOUBLE )
check_type_size( "void *" SIZEOF_VOID_P )
check_type_size( "void *" SIZEOF_VOIDP )
check_type_size( "int *" SIZEOF_INT_P )
check_type_size( "uintptr_t" CELLSIZE )
check_type_size( "wchar_t" SIZEOF_WCHAR_T )
check_library_exists( android main "" HAVE_LIBANDROID )
if (HAVE_LIBANDROID)
set (EXTRALIBS ${EXTRALIBS} android)
endif (HAVE_LIBANDROID)
check_library_exists( m logf "" HAVE_LIBM )
if (HAVE_LIBM)
set(EXTRALIBS ${EXTRALIBS} m)
endif (HAVE_LIBM)
check_library_exists( dl dlopen "" HAVE_LIBDL )
if (HAVE_LIBDL)
set(EXTRALIBS ${EXTRALIBS} dl)
set(HAVE_DLOPEN 1)
endif (HAVE_LIBDL)
if (WIN32)
check_library_exists( comdlg32 FindText "" HAVE_LIBCOMDLG32 )
if (HAVE_LIBCOMDLG32)
set(EXTRALIBS ${EXTRALIBS} comdlg32)
endif (HAVE_LIBCOMDLG32)
check_library_exists( msvcrt strtok "" HAVE_LIBMSCRT )
if (HAVE_LIBMSCRT)
set(EXTRALIBS ${EXTRALIBS} mscrt)
endif (HAVE_LIBMSCRT)
check_library_exists( shell32 main "" HAVE_LIBSHELL32 )
if (HAVE_LIBSHELL32)
set(EXTRALIBS ${EXTRALIBS} shell32)
endif (HAVE_LIBSHELL32)
check_library_exists( wsock32 main "" HAVE_LIBWSOCK32 )
if (HAVE_LIBWSOCK32)
set(EXTRALIBS ${EXTRALIBS} wsock32)
endif (HAVE_LIBWSOCK32)
endif()
check_library_exists( crypt crypt "" HAVE_LIBCRYPT )
if (HAVE_LIBCRYPT)
set(EXTRALIBS ${EXTRALIBS} crypt)
endif (HAVE_LIBCRYPT)
check_library_exists( judy Judy1Set "" HAVE_LIBJUDY )
if (HAVE_LIBJUDY)
set(EXTRALIBS ${EXTRALIBS} judy)
endif (HAVE_LIBJUDY)
check_library_exists( log main "" HAVE_LIBLOG )
if (HAVE_LIBLOG)
set(EXTRALIBS ${EXTRALIBS} log)
endif (HAVE_LIBLOG)
check_library_exists( nsl nis_add "" HAVE_LIBNSL )
if (HAVE_LIBNSL)
set(EXTRALIBS ${EXTRALIBS} nsl)
endif (HAVE_LIBNSL)
check_library_exists( nss_dns main "" HAVE_LIBNSS_DNS )
if (HAVE_LIBNSS_DNS)
set(EXTRALIBS ${EXTRALIBS} nss_dns)
endif (HAVE_LIBNSS_DNS)
check_library_exists( nss_files main "" HAVE_LIBNSS_FILES )
if (HAVE_LIBNSS_FILES)
set(EXTRALIBS ${EXTRALIBS} nss_files)
endif (HAVE_LIBNSS_FILES)
check_library_exists( psapi main "" HAVE_LIBPSAPI )
if (HAVE_LIBPSAPI)
set(EXTRALIBS ${EXTRALIBS} psapi)
endif (HAVE_LIBPSAPI)
check_library_exists( resolv main "" HAVE_LIBRESOLV )
if (HAVE_LIBRESOLV)
set(EXTRALIBS ${EXTRALIBS} resolv)
endif (HAVE_LIBRESOLV)
check_library_exists( socket main "" HAVE_LIBSOCKET )
if (HAVE_LIBSOCKET)
set(EXTRALIBS ${EXTRALIBS} socket)
endif (HAVE_LIBSOCKET)
check_library_exists( stdc__ main "" HAVE_LIBSTDC__ )
if (HAVE_LIBSTDC__)
set(EXTRALIBS ${EXTRALIBS} stdc__)
endif (HAVE_LIBSTDC__)
check_library_exists( unicode main "" HAVE_LIBUNICODE )
if (HAVE_LIBUNICODE)
set(EXTRALIBS ${EXTRALIBS} unicode)
endif (HAVE_LIBUNICODE)
check_library_exists( ws2_32 main "" HAVE_LIBWS2_32 )
if (HAVE_LIBWS2_32)
set(EXTRALIBS ${EXTRALIBS} ws2_32)
endif (HAVE_LIBWS2_32)
check_library_exists( xnet main "" HAVE_LIBXNET )
if (HAVE_LIBXNET)
set(EXTRALIBS ${EXTRALIBS} xnet)
endif (HAVE_LIBXNET)
check_function_exists( access HAVE_ACCESS )
check_function_exists( acosh HAVE_ACOSH )
check_function_exists( asinh HAVE_ASINH )
check_function_exists( atanh HAVE_ATANH )
check_function_exists( chdir HAVE_CHDIR )
check_function_exists( clock HAVE_CLOCK )
check_function_exists( clock_gettime HAVE_CLOCK_GETTIME )
check_function_exists( crypt HAVE_CRYPT )
check_function_exists( ctime HAVE_CTIME )
check_function_exists( dup2 HAVE_DUP2 )
check_function_exists( dynarray HAVE_DYNARRAY )
check_function_exists( environ HAVE_ENVIRON )
check_function_exists( erf HAVE_ERF )
check_function_exists( feclearexcept HAVE_FECLEAREXCEPT )
check_function_exists( feenableexcept HAVE_FEENABLEEXCEPT )
check_function_exists( fesetexceptflag HAVE_FESETEXCEPTFLAG )
check_function_exists( fesetround HAVE_FESETROUND )
check_function_exists( fesettrapenable HAVE_FESETTRAPENABLE )
check_function_exists( fetestexcept HAVE_FETESTEXCEPT )
check_symbol_exists( ffsl <string.h> HAVE_FFSL )
check_symbol_exists( ffsll <string.h> HAVE_FFSLL )
check_function_exists( __builtin_ffsll HAVE___BUILTIN_FFSLL )
check_function_exists( fgetpos HAVE_FGETPOS )
check_function_exists( finite HAVE_FINITE )
check_symbol_exists( flsl <string.h> HAVE_FLSL )
check_symbol_exists( flsll <string.h> HAVE_FLSLL )
check_function_exists( fpclass HAVE_FPCLASS )
check_function_exists( ftime HAVE_FTIME )
check_function_exists( ftruncate HAVE_FTRUNCATE )
check_function_exists( gcc HAVE_GCC )
check_function_exists( getcwd HAVE_GETCWD )
check_function_exists( getenv HAVE_GETENV )
check_function_exists( getexecname HAVE_GETEXECNAME )
check_function_exists( gethostbyname HAVE_GETHOSTBYNAME )
check_function_exists( gethostent HAVE_GETHOSTENT )
check_function_exists( gethostid HAVE_GETHOSTID )
check_function_exists( gethostname HAVE_GETHOSTNAME )
check_function_exists( gethrtime HAVE_GETHRTIME )
check_function_exists( getpagesize HAVE_GETPAGESIZE )
check_function_exists( getpid HAVE_GETPID )
check_function_exists( getpwnam HAVE_GETPWNAM )
check_function_exists( getrlimit HAVE_GETRLIMIT )
check_function_exists( getrusage HAVE_GETRUSAGE )
check_function_exists( gettimeofday HAVE_GETTIMEOFDAY )
check_function_exists( getwd HAVE_GETWD )
check_function_exists( gmtime HAVE_GMTIME )
check_function_exists( h_errno HAVE_H_ERRNO )
check_function_exists( isatty HAVE_ISATTY )
check_function_exists( isfinite HAVE_ISFINITE )
check_function_exists( isinf HAVE_ISINF )
check_function_exists( isnan HAVE_ISNAN )
check_function_exists( kill HAVE_KILL )
check_function_exists( labs HAVE_LABS )
check_function_exists( lgamma HAVE_LGAMMA )
check_function_exists( rand HAVE_RAND )
check_function_exists( random HAVE_RANDOM )
check_function_exists( readlink HAVE_READLINK )
check_function_exists( regexec HAVE_REGEXEC )
check_function_exists( rename HAVE_RENAME )
check_function_exists( restartable_syscalls HAVE_RESTARTABLE_SYSCALLS )
check_function_exists( rint HAVE_RINT )
check_function_exists( sbrk HAVE_SBRK )
check_function_exists( select HAVE_SELECT )
check_function_exists( setbuf HAVE_SETBUF )
check_function_exists( setitimer HAVE_SETITIMER )
check_function_exists( setlinebuf HAVE_SETLINEBUF )
check_function_exists( setlocale HAVE_SETLOCALE )
check_function_exists( setsid HAVE_SETSID )
check_function_exists( shmat HAVE_SHMAT )
check_function_exists( sigaction HAVE_SIGACTION )
check_symbol_exists( SIGFPE signal.h HAVE_SIGFPE )
check_function_exists( siggetmask HAVE_SIGGETMASK )
check_symbol_exists( SIGINFO signal.h HAVE_SIGINFO )
check_function_exists( siginterrupt HAVE_SIGINTERRUPT )
check_function_exists( signal HAVE_SIGNAL )
check_function_exists( sigprocmask HAVE_SIGPROCMASK )
check_symbol_exists( SIGPROF signal.h HAVE_SIGPROF )
check_symbol_exists( SIGSEGV signal.h HAVE_SIGSEGV )
check_symbol_exists( sigsetjmp setjmp.h HAVE_SIGSETJMP )
check_function_exists( sleep HAVE_SLEEP )
check_function_exists( snprintf HAVE_SNPRINTF )
check_function_exists( socket HAVE_SOCKET )
check_function_exists( socklen_t HAVE_SOCKLEN_T )
check_function_exists( sqllen HAVE_SQLLEN )
check_function_exists( sqlulen HAVE_SQLULEN )
check_function_exists( srand HAVE_SRAND )
check_function_exists( srandom HAVE_SRANDOM )
check_function_exists( ssize_t HAVE_SSIZE_T )
check_function_exists( stat HAVE_STAT )
check_function_exists( strcasecmp HAVE_STRCASECMP )
check_function_exists( strcasestr HAVE_STRCASESTR )
check_function_exists( strchr HAVE_STRCHR )
check_function_exists( strerror HAVE_STRERROR )
check_function_exists( stricmp HAVE_STRICMP )
check_function_exists( strlwr HAVE_STRLWR )
check_function_exists( strncasecmp HAVE_STRNCASECMP )
check_function_exists( strncat HAVE_STRNCAT )
check_function_exists( strncpy HAVE_STRNCPY )
check_function_exists( strnlen HAVE_STRNLEN )
check_function_exists( strtod HAVE_STRTOD )
check_function_exists( struct_time_tm_gmtoff HAVE_STRUCT_TIME_TM_GMTOFF )
check_function_exists( system HAVE_SYSTEM )
check_function_exists( time HAVE_TIME )
check_function_exists( timegm HAVE_TIMEGM )
check_function_exists( times HAVE_TIMES )
check_symbol_exists( timezone time.h HAVE_VAR_TIMEZONE )
check_function_exists( tmpnam HAVE_TMPNAM )
check_function_exists( ttyname HAVE_TTYNAME )
check_function_exists( usleep HAVE_USLEEP )
check_function_exists( utime HAVE_UTIME )
check_function_exists( var_timezone HAVE_VAR_TIMEZONE )
check_function_exists( vfork HAVE_VFORK )
check_function_exists( vsnprintf HAVE_VSNPRINTF )
check_function_exists( waitpid HAVE_WAITPID )
check_function_exists( wcsdup HAVE_WCSDUP )
check_function_exists( wcsnlen HAVE_WCSNLEN )
check_function_exists( _bool HAVE__BOOL )
check_function_exists( _chsize_s HAVE__CHSIZE_S )
check_function_exists( _NSGetEnviron HAVE__NSGETENVIRON )

159
cmake/ConfigureChecks.cmake Normal file
View File

@@ -0,0 +1,159 @@
include(CheckIncludeFiles)
include(CheckFunctionExists)
include(CheckPrototypeExists)
# Test signal handler return type (mimics AC_TYPE_SIGNAL)
include(TestSignalType) #check if this is really needed as c89 defines this as void
# Test standard headers (mimics AC_HEADER_STDC)
include(TestSTDC)
#
# Check header files
#
check_include_files(alloca.h HAVE_ALLOCA_H)
# check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
check_include_files(ctype.h HAVE_CTYPE_H)
check_include_files(crypt.h HAVE_CRYPT_H)
check_include_files(direct.h HAVE_DIRECT_H)
check_include_files(dirent.h HAVE_DIRENT_H)
# check_include_files(dlfcn.h HAVE_DLFCN_H)
check_include_files(errno.h HAVE_ERRNO_H)
check_include_files(execinfo.h HAVE_EXECINFO_H)
check_include_files(fcntl.h HAVE_FCNTL_H)
check_include_files(fenv.h HAVE_FENV_H)
check_include_files(float.h HAVE_FLOAT_H)
check_include_files(fpu_control.h HAVE_FPU_CONTROL_H)
check_include_files(ieeefp.h HAVE_IEEEFP_H)
check_include_files(io.h HAVE_IO_H)
check_include_files(limits.h HAVE_LIMITS_H)
check_include_files(locale.h HAVE_LOCALE_H)
# check_include_files(mach-o/dyld.h HAVE_MACH_O_DYLD_H)
check_include_files(malloc.h HAVE_MALLOC_H)
check_include_files(math.h HAVE_MATH_H)
check_include_files(memory.h HAVE_MEMORY_H)
# check_include_files(netdb.h HAVE_NETDB_H)
# check_include_files(netinet/in.h HAVE_NETINET_IN_H)
check_include_files(netinet/tcp.h HAVE_NETINET_TCP_H)
check_include_files(pwd.h HAVE_PWD_H)
# check_include_files(regex.h HAVE_REGEX_H)
check_include_files(siginfo.h HAVE_SIGINFO_H)
check_include_files(signal.h HAVE_SIGNAL_H)
check_include_files(stdarg.h HAVE_STDARG_H)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(string.h HAVE_STRING_H)
# check_include_files(stropts.h HAVE_STROPTS_H)
# check_include_files(sys/conf.h HAVE_SYS_CONF_H)
check_include_files(sys/dir.h HAVE_SYS_DIR_H)
check_include_files(sys/file.h HAVE_SYS_FILE_H)
check_include_files(sys/mman.h HAVE_SYS_MMAN_H)
check_include_files(sys/ndir.h HAVE_SYS_NDIR_H)
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
check_include_files(sys/resource.h HAVE_SYS_RESOURCE_H)
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
check_include_files(sys/shm.h HAVE_SYS_SHM_H)
# check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
check_include_files(sys/time.h HAVE_SYS_TIME_H)
check_include_files(sys/times.h HAVE_SYS_TIMES_H)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(sys/ucontext.h HAVE_SYS_UCONTEXT_H)
# check_include_files(sys/un.h HAVE_SYS_UN_H)
check_include_files(sys/wait.h HAVE_SYS_WAIT_H)
check_include_files(time.h HAVE_TIME_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(utime.h HAVE_UTIME_H)
check_include_files(wctype.h HAVE_WCTYPE_H)
#check_include_files(winsock.h HAVE_WINSOCK_H)
#check_include_files(winsock2.h HAVE_WINSOCK2_H)
#
# Check Function Exists
#
check_function_exists(_NSGetEnviron HAVE__NSGETENVIRON)
check_function_exists(_chsize_s HAVE__CHSIZE_S)
check_function_exists(access HAVE_ACCESS)
check_function_exists(acosh HAVE_ACOSH)
check_function_exists(alloca HAVE_ALLOCA)
check_function_exists(asinh HAVE_ASINH)
check_function_exists(atanh HAVE_ATANH)
# check_function_exists(chdir HAVE_CHDIR)
check_function_exists(clock HAVE_CLOCK)
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
# check_function_exists(ctime HAVE_CTIME)
check_function_exists(dlopen HAVE_DLOPEN)
# check_function_exists(dup2 HAVE_DUP2)
check_function_exists(erf HAVE_ERF)
# check_function_exists(feclearexcept HAVE_FECLEAREXCEPT)
check_function_exists(fesettrapenable HAVE_FESETTRAPENABLE)
# check_function_exists(fgetpos HAVE_FGETPOS)
check_function_exists(finite HAVE_FINITE)
check_function_exists(fpclass HAVE_FPCLASS)
check_function_exists(ftime HAVE_FTIME)
check_function_exists(getcwd HAVE_GETCWD)
check_function_exists(getenv HAVE_GETENV)
# check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
# check_function_exists(gethostent HAVE_GETHOSTENT)
check_function_exists(gethostid HAVE_GETHOSTID)
check_function_exists(gethostname HAVE_GETHOSTNAME)
check_function_exists(gethrtime HAVE_GETHRTIME)
check_function_exists(getpagesize HAVE_GETPAGESIZE)
check_function_exists(getpwnam HAVE_GETPWNAM)
check_function_exists(getrlimit HAVE_GETRLIMIT)
check_function_exists(getrusage HAVE_GETRUSAGE)
check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
check_function_exists(getwd HAVE_GETWD)
check_function_exists(isatty HAVE_ISATTY)
check_function_exists(isnan HAVE_ISNAN)
check_function_exists(isinf HAVE_ISINF)
# check_function_exists(kill HAVE_KILL)
# check_function_exists(labs HAVE_LABS)
check_function_exists(link HAVE_LINK)
check_function_exists(lgamma HAVE_LGAMMA)
check_function_exists(localtime HAVE_LOCALTIME)
check_function_exists(lstat HAVE_LSTAT)
check_function_exists(mallinfo HAVE_MALLINFO)
check_function_exists(mbscoll HAVE_MBSCOLL)
check_function_exists(mbscasecoll HAVE_MBSCASECOLL)
check_function_exists(mbsnrtowcs HAVE_MBSNRTOWCS)
check_function_exists(memcpy HAVE_MEMCPY)
check_function_exists(memmove HAVE_MEMMOVE)
check_function_exists(mkstemp HAVE_MKSTEMP)
check_function_exists(mktemp HAVE_MKTEMP)
check_function_exists(nanosleep HAVE_NANOSLEEP)
check_function_exists(mktime HAVE_MKTIME)
check_function_exists(opendir HAVE_OPENDIR)
check_function_exists(putenv HAVE_PUTENV)
check_function_exists(rand HAVE_RAND)
check_function_exists(random HAVE_RANDOM)
check_function_exists(readlink HAVE_READLINK)
check_function_exists(regexec HAVE_REGEXEC)
check_function_exists(rename HAVE_RENAME)
check_function_exists(rint HAVE_RINT)
# check_function_exists(sbrk HAVE_SBRK)
check_function_exists(select HAVE_SELECT)
check_function_exists(setbuf HAVE_SETBUF)
check_function_exists(setitimer HAVE_SETITIMER)
check_function_exists(setlocale HAVE_SETLOCALE)
check_function_exists(setsid HAVE_SETSID)
# check_function_exists(setlinebuf HAVE_SETLINEBUF)
check_function_exists(sigaction HAVE_SIGACTION)
# check_function_exists(siggetmask HAVE_SIGGETMASK)
# check_function_exists(siginterrupt HAVE_SIGINTERRUPT)
check_function_exists(signal HAVE_SIGNAL)
check_function_exists(sigprocmask HAVE_SIGPROCMASK)
# check_function_exists(socket HAVE_SOCKET)
check_function_exists(stat HAVE_STAT)
# check_function_exists(strchr HAVE_STRCHR)
check_function_exists(strerror HAVE_STRERROR)
check_function_exists(stricmp HAVE_STRICMP)
check_function_exists(strlwr HAVE_STRLWR)
check_function_exists(strncat HAVE_STRNCAT)
check_function_exists(strncpy HAVE_STRNCPY)
# check_function_exists(strtod HAVE_STRTOD)
check_function_exists(time HAVE_TIME)
check_function_exists(times HAVE_TIMES)
check_function_exists(tmpnam HAVE_TMPNAM)
check_function_exists(usleep HAVE_USLEEP)
check_function_exists(utime HAVE_UTIME)
check_function_exists(vsnprintf HAVE_VSNPRINTF)

23
cmake/FindGMP.cmake Normal file
View File

@@ -0,0 +1,23 @@
# Try to find the GMP librairies
# GMP_FOUND - system has GMP lib
# GMP_INCLUDE_DIR - the GMP include directory
# GMP_LIBRARIES - Libraries needed to use GMP
# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (GMP_INCLUDE_DIR AND GMP_LIBRARIES)
# Already in cache, be silent
set(GMP_FIND_QUIETLY TRUE)
endif (GMP_INCLUDE_DIR AND GMP_LIBRARIES)
find_path(GMP_INCLUDE_DIR NAMES gmp.h )
find_library(GMP_LIBRARIES NAMES gmp libgmp)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG GMP_INCLUDE_DIR GMP_LIBRARIES)
mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES)

59
cmake/FindGecode.cmake Normal file
View File

@@ -0,0 +1,59 @@
#source from http://code.google.com/p/cpfloat-gecode/source/browse/trunk/cmake-support/FindGecode.cmake?r=9
#Works under the assumption than when gecode is installed at least the kernel component exists
# Look for the header file
find_path(GECODE_INCLUDE_DIR NAMES gecode/kernel.hh)
find_file(GECODE_CONFIG gecode/support/config.hpp)
# Look for the library
find_library(GECODE_LIBRARY NAMES gecodekernel)
find_library(GECODE_SUPPORT_LIBRARY NAMES gecodesupport)
if(GECODE_CONFIG)
file(STRINGS ${GECODE_CONFIG} GECODE_LINE_VERSION REGEX "^#define GECODE_VERSION .*")
string(REGEX MATCH "[0-9].[0-9].[0-9]" GECODE_VERSION ${GECODE_LINE_VERSION})
endif()
if(GECODE_INCLUDE_DIR AND GECODE_LIBRARY AND GECODE_SUPPORT_LIBRARY)
set(GECODE_FOUND Yes)
endif()
if(GECODE_FOUND)
set(GECODE_LIBRARIES ${GECODE_LIBRARY} ${GECODE_SUPPORT_LIBRARY})
set(GECODE_INCLUDE_DIRS ${GECODE_INCLUDE_DIR})
find_library(GECODE_DRIVER_LIBRARY gecodedriver)
if(GECODE_DRIVER_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_DRIVER_LIBRARY})
endif()
find_library(GECODE_FZ_LIBRARY gecodeflatzinc)
if(GECODE_FZ_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_FZ_LIBRARY})
endif()
find_library(GECODE_GIST_LIBRARY gecodegist)
if(GECODE_GIST_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_GIST_LIBRARY})
endif()
find_library(GECODE_GRAPH_LIBRARY gecodegraph)
if(GECODE_GRAPH_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_GRAPH_LIBRARY})
endif()
find_library(GECODE_INT_LIBRARY gecodeint)
if(GECODE_INT_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_INT_LIBRARY})
endif()
find_library(GECODE_MM_LIBRARY gecodeminimodel)
if(GECODE_MM_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_MM_LIBRARY})
endif()
find_library(GECODE_SCHEDULING_LIBRARY gecodescheduling)
if(GECODE_SCHEDULING_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_SCHEDULING_LIBRARY})
endif()
find_library(GECODE_SEARCH_LIBRARY gecodesearch)
if(GECODE_SEARCH_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_SEARCH_LIBRARY})
endif()
find_library(GECODE_SET_LIBRARY gecodeset)
if(GECODE_SET_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_SET_LIBRARY})
endif()
endif()

47
cmake/FindMySQL.cmake Normal file
View File

@@ -0,0 +1,47 @@
# - Find mysqlclient
# Find the native MySQL includes and library
#
# MYSQL_INCLUDE_DIR - where to find mysql.h, etc.
# MYSQL_LIBRARIES - List of libraries when using MySQL.
# MYSQL_FOUND - True if MySQL found.
IF (MYSQL_INCLUDE_DIR)
# Already in cache, be silent
SET(MYSQL_FIND_QUIETLY TRUE)
ENDIF (MYSQL_INCLUDE_DIR)
FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
/usr/local/include/mysql
/usr/include/mysql
)
SET(MYSQL_NAMES mysqlclient mysqlclient_r)
FIND_LIBRARY(MYSQL_LIBRARY
NAMES ${MYSQL_NAMES}
PATHS /usr/lib /usr/local/lib
PATH_SUFFIXES mysql
)
IF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
SET(MYSQL_FOUND TRUE)
SET( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
ELSE (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
SET(MYSQL_FOUND FALSE)
SET( MYSQL_LIBRARIES )
ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
IF (MYSQL_FOUND)
IF (NOT MYSQL_FIND_QUIETLY)
MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARY}")
ENDIF (NOT MYSQL_FIND_QUIETLY)
ELSE (MYSQL_FOUND)
IF (MYSQL_FIND_REQUIRED)
MESSAGE(STATUS "Looked for MySQL libraries named ${MYSQL_NAMES}.")
MESSAGE(FATAL_ERROR "Could NOT find MySQL library")
ENDIF (MYSQL_FIND_REQUIRED)
ENDIF (MYSQL_FOUND)
MARK_AS_ADVANCED(
MYSQL_LIBRARY
MYSQL_INCLUDE_DIR
)

57
cmake/FindODBC.cmake Normal file
View File

@@ -0,0 +1,57 @@
#
# Find the ODBC driver manager includes and library.
#
# ODBC is an open standard for connecting to different databases in a
# semi-vendor-independent fashion. First you install the ODBC driver
# manager. Then you need a driver for each separate database you want
# to connect to (unless a generic one works). VTK includes neither
# the driver manager nor the vendor-specific drivers: you have to find
# those yourself.
#
# This module defines
# ODBC_INCLUDE_DIRECTORIES, where to find sql.h
# ODBC_LIBRARIES, the libraries to link against to use ODBC
# ODBC_FOUND. If false, you cannot build anything that requires MySQL.
# also defined, but not for general use is
# ODBC_LIBRARY, where to find the ODBC driver manager library.
set(ODBC_FOUND FALSE)
find_path(ODBC_INCLUDE_DIRECTORIES sql.h
/usr/include
/usr/include/odbc
/usr/local/include
/usr/local/include/odbc
/usr/local/odbc/include
"C:/Program Files/ODBC/include"
"C:/Program Files/Microsoft SDKs/Windows/v7.0/include"
"C:/Program Files/Microsoft SDKs/Windows/v6.0a/include"
"C:/ODBC/include"
DOC "Specify the directory containing sql.h."
)
find_library(ODBC_LIBRARY
NAMES iodbc odbc odbcinst odbc32
PATHS
/usr/lib
/usr/lib/odbc
/usr/local/lib
/usr/local/lib/odbc
/usr/local/odbc/lib
"C:/Program Files/ODBC/lib"
"C:/ODBC/lib/debug"
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib"
DOC "Specify the ODBC driver manager library here."
)
if(ODBC_LIBRARY)
if(ODBC_INCLUDE_DIRECTORIES)
set( ODBC_FOUND 1 )
endif()
endif()
set(ODBC_LIBRARIES ${ODBC_LIBRARY})
mark_as_advanced(ODBC_FOUND ODBC_LIBRARY ODBC_EXTRA_LIBRARIES ODBC_INCLUDE_DIRECTORIES)

99
cmake/FindR.cmake Normal file
View File

@@ -0,0 +1,99 @@
# -*- cmake -*-
#
# FindR.cmake: Try to find R
#
# (C) Copyright 2005-2012 EDF-EADS-Phimeca
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# @author dutka
# @date 2010-02-04 16:44:49 +0100 (Thu, 04 Feb 2010)
# Id Makefile.am 1473 2010-02-04 15:44:49Z dutka
#
#
# - Try to find R
# Once done this will define
#
# R_FOUND - System has R
# R_LIBRARIES - The libraries needed to use R
# R_DEFINITIONS - Compiler switches required for using R
# R_EXECUTABLE - The R interpreter
if ( R_EXECUTABLE AND R_LIBRARIES )
# in cache already
set( R_FIND_QUIETLY TRUE )
endif ( R_EXECUTABLE AND R_LIBRARIES )
#IF (NOT WIN32)
# # use pkg-config to get the directories and then use these values
# # in the FIND_PATH() and FIND_LIBRARY() calls
# FIND_PACKAGE(PkgConfig)
# PKG_CHECK_MODULES(PC_R R)
# SET(R_DEFINITIONS ${PC_R_CFLAGS_OTHER})
#ENDIF (NOT WIN32)
find_program ( R_EXECUTABLE
NAMES R R.exe
DOC "Path to the R command interpreter"
)
get_filename_component ( _R_EXE_PATH ${R_EXECUTABLE} PATH )
if ( R_EXECUTABLE )
execute_process ( COMMAND ${R_EXECUTABLE} RHOME
OUTPUT_VARIABLE _R_HOME
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif ( R_EXECUTABLE )
find_library ( R_LIBRARIES
NAMES R
HINTS
${PC_R_LIBDIR}
${PC_R_LIBRARY_DIRS}
${_R_HOME}/lib
${_R_HOME}/lib/x86_64
)
set ( R_PACKAGES )
if ( R_EXECUTABLE )
foreach ( _component ${R_FIND_COMPONENTS} )
if ( NOT R_${_component}_FOUND )
execute_process ( COMMAND echo "library(${_component})"
COMMAND ${R_EXECUTABLE} --no-save --silent --no-readline --slave
RESULT_VARIABLE _res
OUTPUT_VARIABLE _trashout
ERROR_VARIABLE _trasherr
)
if ( NOT _res )
message ( STATUS "Looking for R package ${_component} - found" )
set ( R_${_component}_FOUND 1 CACHE INTERNAL "True if R package ${_component} is here" )
else ( NOT _res )
message ( STATUS "Looking for R package ${_component} - not found" )
set ( R_${_component}_FOUND 0 CACHE INTERNAL "True if R package ${_component} is here" )
endif ( NOT _res )
list ( APPEND R_PACKAGES R_${_component}_FOUND )
endif ( NOT R_${_component}_FOUND )
endforeach ( _component )
endif ( R_EXECUTABLE )
include ( FindPackageHandleStandardArgs )
# handle the QUIETLY and REQUIRED arguments and set R_FOUND to TRUE if
# all listed variables are TRUE
find_package_handle_standard_args ( R DEFAULT_MSG R_EXECUTABLE R_LIBRARIES ${R_PACKAGES} )
mark_as_advanced ( R_EXECUTABLE R_LIBRARIES ${R_PACKAGES} )

106
cmake/FindRAPTOR.cmake Executable file
View File

@@ -0,0 +1,106 @@
# Copyright (C) 2012 - 2013 by Pedro Mendes, Virginia Tech Intellectual
# Properties, Inc., University of Heidelberg, and The University
# of Manchester.
# All rights reserved.
# - Try to find the Raptor RDF parsing library (http://librdf.org/raptor/)
# Once done this will define
#
# RAPTOR_FOUND - system has Raptor
# RAPTOR_LIBRARIES - Link these to use Raptor
# RAPTOR_INCLUDE_DIR - Include directory for using Raptor
# RAPTOR_DEFINITIONS - Compiler switches required for using Raptor
#
# Capabilities
# RAPTOR_HAVE_TRIG - Set if raptor has TRIG
# (c) 2007-2011 Sebastian Trueg <trueg@kde.org>
# (c) 2011 Artem Serebriyskiy <v.for.vandal@gmail.com>
# (c) 2011 Michael Jansen <kde@michael-jansen.biz>
#
# Based on FindFontconfig Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
MACRO (FIND_RAPTOR)
ENDMACRO ()
# Check if we have cached results in case the last round was successful.
if (NOT (RAPTOR_INCLUDE_DIR AND RAPTOR_LIBRARIES) OR NOT RAPTOR_FOUND)
set(RAPTOR_LDFLAGS)
find_path(RAPTOR_INCLUDE_DIR raptor.h
PATHS $ENV{RAPTOR_DIR}/include
$ENV{RAPTOR_DIR}
~/Library/Frameworks
/Library/Frameworks
/sw/include # Fink
/opt/local/include # MacPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
NO_DEFAULT_PATH)
if (NOT RAPTOR_INCLUDE_DIR)
find_path(RAPTOR_INCLUDE_DIR raptor.h)
endif ()
find_library(RAPTOR_LIBRARY
NAMES raptor
PATHS $ENV{RAPTOR_DIR}/lib
$ENV{RAPTOR_DIR}/lib-dbg
$ENV{RAPTOR_DIR}
~/Library/Frameworks
/Library/Frameworks
/sw/lib # Fink
/opt/local/lib # MacPorts
/opt/csw/lib # Blastwave
/opt/lib
/usr/freeware/lib64
NO_DEFAULT_PATH)
if (NOT RAPTOR_LIBRARY)
find_library(RAPTOR_LIBRARY NAMES raptor)
endif ()
if (NOT WIN32)
find_package(PkgConfig)
pkg_check_modules(PC_RAPTOR QUIET raptor)
if (PC_RAPTOR_FOUND)
set(RAPTOR_DEFINITIONS ${PC_RAPTOR_CFLAGS_OTHER})
set(RAPTOR_VERSION ${PC_RAPTOR_VERSION} CACHE STRING "Raptor Version found" )
string( REGEX REPLACE "^.*-lraptor;" "" RAPTOR_LDFLAGS "${PC_RAPTOR_STATIC_LDFLAGS}")
string( REGEX REPLACE "-lexpat[;]*" "" RAPTOR_LDFLAGS "${RAPTOR_LDFLAGS}")
endif (PC_RAPTOR_FOUND)
endif (NOT WIN32)
if (RAPTOR_LDFLAGS)
set(RAPTOR_LIBRARY ${RAPTOR_LIBRARY} ${RAPTOR_LDFLAGS})
endif (RAPTOR_LDFLAGS)
mark_as_advanced(RAPTOR_INCLUDE_DIR RAPTOR_LIBRARY)
endif () # Check for cached values
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
Raptor
VERSION_VAR RAPTOR_VERSION
REQUIRED_VARS RAPTOR_LIBRARY RAPTOR_INCLUDE_DIR)
mark_as_advanced(RAPTOR_VERSION)
if (NOT RAPTOR_FOUND AND Raptor_FIND_VERSION_MAJOR EQUAL "2" AND NOT Raptor_FIND_QUIET )
pkg_check_modules(PC_RAPTOR QUIET raptor)
if (PC_RAPTOR_FOUND)
message( STATUS "You have raptor1 version ${PC_RAPTOR_VERSION} installed. Please update." )
endif ()
endif ()

21
cmake/FindReadline.cmake Normal file
View File

@@ -0,0 +1,21 @@
# Find the Readline libraries
#
# READLINE_FOUND - system has Readline lib
# READLINE_INCLUDE_DIR - the Readline include directory
# READLINE_LIBRARIES - Libraries needed to use Readline
# READLINE_HAVE_READLINE_HISTORY_H - true if readline/history.h is available
if (READLINE_INCLUDE_DIR AND READLINE_LIBRARIES)
# Already in cache, be silent
set(READLINE_FIND_QUIETLY TRUE)
endif (READLINE_INCLUDE_DIR AND READLINE_LIBRARIES)
find_path(READLINE_INCLUDE_DIR NAMES readline/readline.h )
find_library(READLINE_LIBRARIES NAMES readline libreadline)
find_file(READLINE_HAVE_READLINE_HISTORY_H readline/history.h)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(READLINE DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARIES)
mark_as_advanced(READLINE_INCLUDE_DIR READLINE_LIBRARIES)

56
cmake/FindSqlite3.cmake Normal file
View File

@@ -0,0 +1,56 @@
# - find Sqlite 3
# SQLITE3_INCLUDE_DIR - Where to find Sqlite 3 header files (directory)
# SQLITE3_LIBRARIES - Sqlite 3 libraries
# SQLITE3_LIBRARY_RELEASE - Where the release library is
# SQLITE3_LIBRARY_DEBUG - Where the debug library is
# SQLITE3_FOUND - Set to TRUE if we found everything (library, includes and executable)
# Copyright (c) 2010 Pau Garcia i Quiles, <pgquiles@elpauer.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
# Generated by CModuler, a CMake Module Generator - http://gitorious.org/cmoduler
IF( SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY_RELEASE AND SQLITE3_LIBRARY_DEBUG )
SET(SQLITE3_FIND_QUIETLY TRUE)
ENDIF( SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY_RELEASE AND SQLITE3_LIBRARY_DEBUG )
FIND_PATH( SQLITE3_INCLUDE_DIR sqlite3.h )
FIND_LIBRARY(SQLITE3_LIBRARY_RELEASE NAMES sqlite3 )
FIND_LIBRARY(SQLITE3_LIBRARY_DEBUG NAMES sqlite3 sqlite3d HINTS /usr/lib/debug/usr/lib/ )
IF( SQLITE3_LIBRARY_RELEASE OR SQLITE3_LIBRARY_DEBUG AND SQLITE3_INCLUDE_DIR )
SET( SQLITE3_FOUND TRUE )
ENDIF( SQLITE3_LIBRARY_RELEASE OR SQLITE3_LIBRARY_DEBUG AND SQLITE3_INCLUDE_DIR )
IF( SQLITE3_LIBRARY_DEBUG AND SQLITE3_LIBRARY_RELEASE )
# if the generator supports configuration types then set
# optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
IF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
SET( SQLITE3_LIBRARIES optimized ${SQLITE3_LIBRARY_RELEASE} debug ${SQLITE3_LIBRARY_DEBUG} )
ELSE( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
# if there are no configuration types and CMAKE_BUILD_TYPE has no value
# then just use the release libraries
SET( SQLITE3_LIBRARIES ${SQLITE3_LIBRARY_RELEASE} )
ENDIF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
ELSEIF( SQLITE3_LIBRARY_RELEASE )
SET( SQLITE3_LIBRARIES ${SQLITE3_LIBRARY_RELEASE} )
ELSE( SQLITE3_LIBRARY_DEBUG AND SQLITE3_LIBRARY_RELEASE )
SET( SQLITE3_LIBRARIES ${SQLITE3_LIBRARY_DEBUG} )
ENDIF( SQLITE3_LIBRARY_DEBUG AND SQLITE3_LIBRARY_RELEASE )
IF( SQLITE3_FOUND )
IF( NOT SQLITE3_FIND_QUIETLY )
MESSAGE( STATUS "Found Sqlite3 header file in ${SQLITE3_INCLUDE_DIR}")
MESSAGE( STATUS "Found Sqlite3 libraries: ${SQLITE3_LIBRARIES}")
ENDIF( NOT SQLITE3_FIND_QUIETLY )
ELSE(SQLITE3_FOUND)
IF( SQLITE3_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could not find Sqlite3" )
ELSE( SQLITE3_FIND_REQUIRED)
MESSAGE( STATUS "Optional package Sqlite3 was not found" )
ENDIF( SQLITE3_FIND_REQUIRED)
ENDIF(SQLITE3_FOUND)

157
cmake/MacroLogFeature.cmake Normal file
View File

@@ -0,0 +1,157 @@
# This file defines the Feature Logging macros.
#
# MACRO_LOG_FEATURE(VAR FEATURE DESCRIPTION URL [REQUIRED [MIN_VERSION [COMMENTS]]])
# Logs the information so that it can be displayed at the end
# of the configure run
# VAR : TRUE or FALSE, indicating whether the feature is supported
# FEATURE: name of the feature, e.g. "libjpeg"
# DESCRIPTION: description what this feature provides
# URL: home page
# REQUIRED: TRUE or FALSE, indicating whether the feature is required
# MIN_VERSION: minimum version number. empty string if unneeded
# COMMENTS: More info you may want to provide. empty string if unnecessary
#
# MACRO_DISPLAY_FEATURE_LOG()
# Call this to display the collected results.
# Exits CMake with a FATAL error message if a required feature is missing
#
# Example:
#
# INCLUDE(MacroLogFeature)
#
# FIND_PACKAGE(JPEG)
# MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "Support JPEG images" "http://www.ijg.org" TRUE "3.2a" "")
# ...
# MACRO_DISPLAY_FEATURE_LOG()
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
# Copyright (c) 2006, Allen Winter, <winter@kde.org>
# Copyright (c) 2009, Sebastian Trueg, <trueg@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
IF (NOT _macroLogFeatureAlreadyIncluded)
SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
IF (EXISTS ${_file})
FILE(REMOVE ${_file})
ENDIF (EXISTS ${_file})
SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
IF (EXISTS ${_file})
FILE(REMOVE ${_file})
ENDIF (EXISTS ${_file})
SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
IF (EXISTS ${_file})
FILE(REMOVE ${_file})
ENDIF (EXISTS ${_file})
SET(_macroLogFeatureAlreadyIncluded TRUE)
INCLUDE(FeatureSummary)
ENDIF (NOT _macroLogFeatureAlreadyIncluded)
MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _comments)
STRING(TOUPPER "${ARGV4}" _required)
SET(_minvers "${ARGV5}")
SET(_comments "${ARGV6}")
IF (${_var})
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
ELSE (${_var})
IF ("${_required}" STREQUAL "TRUE")
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
ELSE ("${_required}" STREQUAL "TRUE")
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
ENDIF ("${_required}" STREQUAL "TRUE")
ENDIF (${_var})
SET(_logtext " * ${_package}")
IF (NOT ${_var})
IF (${_minvers} MATCHES ".*")
SET(_logtext "${_logtext} (${_minvers} or higher)")
ENDIF (${_minvers} MATCHES ".*")
SET(_logtext "${_logtext} <${_url}>\n ")
ELSE (NOT ${_var})
SET(_logtext "${_logtext} - ")
ENDIF (NOT ${_var})
SET(_logtext "${_logtext}${_description}")
IF (NOT ${_var})
IF (${_comments} MATCHES ".*")
SET(_logtext "${_logtext}\n ${_comments}")
ENDIF (${_comments} MATCHES ".*")
# SET(_logtext "${_logtext}\n") #double-space missing features?
ENDIF (NOT ${_var})
FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n")
IF(COMMAND SET_PACKAGE_INFO) # in FeatureSummary.cmake since CMake 2.8.3
SET_PACKAGE_INFO("${_package}" "\"${_description}\"" "${_url}" "\"${_comments}\"")
ENDIF(COMMAND SET_PACKAGE_INFO)
ENDMACRO(MACRO_LOG_FEATURE)
MACRO(MACRO_DISPLAY_FEATURE_LOG)
IF(COMMAND FEATURE_SUMMARY) # in FeatureSummary.cmake since CMake 2.8.3
FEATURE_SUMMARY(FILENAME ${CMAKE_CURRENT_BINARY_DIR}/FindPackageLog.txt
WHAT ALL)
ENDIF(COMMAND FEATURE_SUMMARY)
SET(_missingFile ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
SET(_enabledFile ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
SET(_disabledFile ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
IF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile})
SET(_printSummary TRUE)
ENDIF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile})
IF(_printSummary)
SET(_missingDeps 0)
IF (EXISTS ${_enabledFile})
FILE(READ ${_enabledFile} _enabled)
FILE(REMOVE ${_enabledFile})
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following external packages were located on your system.\n-- This installation will have the extra features provided by these packages.\n-----------------------------------------------------------------------------\n${_enabled}")
ENDIF (EXISTS ${_enabledFile})
IF (EXISTS ${_disabledFile})
SET(_missingDeps 1)
FILE(READ ${_disabledFile} _disabled)
FILE(REMOVE ${_disabledFile})
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following OPTIONAL packages could NOT be located on your system.\n-- Consider installing them to enable more features from this software.\n-----------------------------------------------------------------------------\n${_disabled}")
ENDIF (EXISTS ${_disabledFile})
IF (EXISTS ${_missingFile})
SET(_missingDeps 1)
FILE(READ ${_missingFile} _requirements)
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following REQUIRED packages could NOT be located on your system.\n-- You must install these packages before continuing.\n-----------------------------------------------------------------------------\n${_requirements}")
FILE(REMOVE ${_missingFile})
SET(_haveMissingReq 1)
ENDIF (EXISTS ${_missingFile})
IF (NOT ${_missingDeps})
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- Congratulations! All external packages have been found.")
ENDIF (NOT ${_missingDeps})
MESSAGE(${_summary})
MESSAGE("-----------------------------------------------------------------------------\n")
IF(_haveMissingReq)
MESSAGE(FATAL_ERROR "Exiting: Missing Requirements")
ENDIF(_haveMissingReq)
ENDIF(_printSummary)
ENDMACRO(MACRO_DISPLAY_FEATURE_LOG)

View File

@@ -0,0 +1,41 @@
# - MACRO_OPTIONAL_ADD_SUBDIRECTORY() combines ADD_SUBDIRECTORY() with an OPTION()
# MACRO_OPTIONAL_ADD_SUBDIRECTORY( <dir> )
# If you use MACRO_OPTIONAL_ADD_SUBDIRECTORY() instead of ADD_SUBDIRECTORY(),
# this will have two effects
# 1 - CMake will not complain if the directory doesn't exist
# This makes sense if you want to distribute just one of the subdirs
# in a source package, e.g. just one of the subdirs in kdeextragear.
# 2 - If the directory exists, it will offer an option to skip the
# subdirectory.
# This is useful if you want to compile only a subset of all
# directories.
#
# If the CMake variable DISABLE_ALL_OPTIONAL_SUBDIRECTORIES is set to TRUE
# for the first CMake run on the project, all optional subdirectories will be disabled
# by default (but can of course be enabled via the respective options).
# E.g. the following will disable all optional subdirectories except the one named "kcalc":
# $ cmake -DDISABLE_ALL_OPTIONAL_SUBDIRECTORIES=TRUE -DBUILD_kcalc=TRUE <srcdir>
# Copyright (c) 2007, Alexander Neundorf, <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
MACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY _dir )
GET_FILENAME_COMPONENT(_fullPath ${_dir} ABSOLUTE)
IF(EXISTS ${_fullPath}/CMakeLists.txt)
IF(DISABLE_ALL_OPTIONAL_SUBDIRECTORIES)
SET(_DEFAULT_OPTION_VALUE FALSE)
ELSE(DISABLE_ALL_OPTIONAL_SUBDIRECTORIES)
SET(_DEFAULT_OPTION_VALUE TRUE)
ENDIF(DISABLE_ALL_OPTIONAL_SUBDIRECTORIES)
IF(DISABLE_ALL_OPTIONAL_SUBDIRS AND NOT DEFINED BUILD_${_dir})
SET(_DEFAULT_OPTION_VALUE FALSE)
ENDIF(DISABLE_ALL_OPTIONAL_SUBDIRS AND NOT DEFINED BUILD_${_dir})
OPTION(BUILD_${_dir} "Build directory ${_dir}" ${_DEFAULT_OPTION_VALUE})
IF(BUILD_${_dir})
ADD_SUBDIRECTORY(${_dir})
ENDIF(BUILD_${_dir})
ENDIF(EXISTS ${_fullPath}/CMakeLists.txt)
ENDMACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY)

View File

@@ -0,0 +1,48 @@
# - MACRO_OPTIONAL_FIND_PACKAGE() combines FIND_PACKAGE() with an OPTION()
# MACRO_OPTIONAL_FIND_PACKAGE( <name> [QUIT] )
# This macro is a combination of OPTION() and FIND_PACKAGE(), it
# works like FIND_PACKAGE(), but additionally it automatically creates
# an option name WITH_<name>, which can be disabled via the cmake GUI.
# or via -DWITH_<name>=OFF
# The standard <name>_FOUND variables can be used in the same way
# as when using the normal FIND_PACKAGE()
# Copyright (c) 2006-2010 Alexander Neundorf, <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# This is just a helper macro to set a bunch of variables empty.
# We don't know whether the package uses UPPERCASENAME or CamelCaseName, so we try both:
macro(_MOFP_SET_EMPTY_IF_DEFINED _name _var)
if(DEFINED ${_name}_${_var})
set(${_name}_${_var} "")
endif(DEFINED ${_name}_${_var})
string(TOUPPER ${_name} _nameUpper)
if(DEFINED ${_nameUpper}_${_var})
set(${_nameUpper}_${_var} "")
endif(DEFINED ${_nameUpper}_${_var})
endmacro(_MOFP_SET_EMPTY_IF_DEFINED _package _var)
macro (MACRO_OPTIONAL_FIND_PACKAGE _name _default)
option(WITH_${_name} "Search for ${_name} package" ${_default})
if (WITH_${_name})
find_package(${_name} ${ARGN})
else (WITH_${_name})
string(TOUPPER ${_name} _nameUpper)
set(${_name}_FOUND FALSE)
set(${_nameUpper}_FOUND FALSE)
_mofp_set_empty_if_defined(${_name} INCLUDE_DIRS)
_mofp_set_empty_if_defined(${_name} INCLUDE_DIR)
_mofp_set_empty_if_defined(${_name} INCLUDES)
_mofp_set_empty_if_defined(${_name} LIBRARY)
_mofp_set_empty_if_defined(${_name} LIBRARIES)
_mofp_set_empty_if_defined(${_name} LIBS)
_mofp_set_empty_if_defined(${_name} FLAGS)
_mofp_set_empty_if_defined(${_name} DEFINITIONS)
endif (WITH_${_name})
endmacro (MACRO_OPTIONAL_FIND_PACKAGE)

View File

@@ -0,0 +1,45 @@
# cmake/TestForHighBitCharacters.cmake
#
# Copyright (C) 2006 Alan W. Irwin
#
# This file is part of PLplot.
#
# PLplot is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; version 2 of the License.
#
# PLplot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with the file PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# Check if ctype.h macros work on characters with the high bit set.
if(NOT DEFINED CMAKE_HIGH_BIT_CHARACTERS)
message(STATUS
"Check for whether ctype.h macros work on characters with the\n"
" high bit set."
)
try_compile(CMAKE_HIGH_BIT_CHARACTERS
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/cmake/TestForHighBitCharacters.c
OUTPUT_VARIABLE OUTPUT)
if(CMAKE_HIGH_BIT_CHARACTERS)
message(STATUS "High-bit characters - work")
set(HIGH_BIT_CHARACTERS 1 CACHE INTERNAL
"Do ctype.h macros work on high-bit characters")
file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Determining if ctype.h macros work on high-bit characters passed with "
"the following output:\n${OUTPUT}\n\n")
else(CMAKE_HIGH_BIT_CHARACTERS)
message(STATUS "High-bit characters - don't work")
set(HIGH_BIT_CHARACTERS 0 CACHE INTERNAL
"Do ctype.h macros work on high-bit characters")
file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Determining if ctype.h macros work on high-bit characters failed with "
"the following output:\n${OUTPUT}\n\n")
endif(CMAKE_HIGH_BIT_CHARACTERS)
endif(NOT DEFINED CMAKE_HIGH_BIT_CHARACTERS)

36
cmake/TestSTDC.cmake Normal file
View File

@@ -0,0 +1,36 @@
# AC_HEADER_STDC is gross overkill since the current PLplot code only uses
# this for whether or not atexit can be used. But implement the full suite
# of AC_HEADER_STDC checks to keep the cmake version in synch with autotools
# and just in case some PLplot developer assumes the complete check for
# standard headers is done for a future programming change.
#
# From info autoconf....
# Define STDC_HEADERS if the system has ANSI C header files.
# Specifically, this macro checks for stdlib.h', stdarg.h',
# string.h', and float.h'; if the system has those, it probably
# has the rest of the ANSI C header files. This macro also checks
# whether string.h' declares memchr' (and thus presumably the
# other mem' functions), whether stdlib.h' declare free' (and
# thus presumably malloc' and other related functions), and whether
# the ctype.h' macros work on characters with the high bit set, as
# ANSI C requires.
message(STATUS "Checking whether system has ANSI C header files")
check_include_files("stdlib.h;stdarg.h;string.h;float.h" StandardHeadersExist)
if(StandardHeadersExist)
check_prototype_exists(memchr string.h memchrExists)
if(memchrExists)
check_prototype_exists(free stdlib.h freeExists)
if(freeExists)
include(TestForHighBitCharacters)
if(CMAKE_HIGH_BIT_CHARACTERS)
message(STATUS "ANSI C header files - found")
set(STDC_HEADERS 1 CACHE INTERNAL "System has ANSI C header files")
endif(CMAKE_HIGH_BIT_CHARACTERS)
endif(freeExists)
endif(memchrExists)
endif(StandardHeadersExist)
if(NOT STDC_HEADERS)
message(STATUS "ANSI C header files - not found")
set(STDC_HEADERS 0 CACHE INTERNAL "System has ANSI C header files")
endif(NOT STDC_HEADERS)

View File

@@ -0,0 +1,47 @@
# cmake/TestSignalType.cmake
#
# Test for the return type of signal defined in <signal.h>
#
# Copyright (C) 2006 Andrew Ross
#
# This file is part of PLplot.
#
# PLplot is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; version 2 of the License.
#
# PLplot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with the file PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# If signal.h defines signal as returning a pointer to a function
# returning void RETSIGTYPE is defined as void. Otherwise RETSIGTYPE is
# defined as int.
IF(NOT DEFINED CMAKE_TEST_SIGNAL_TYPE)
MESSAGE(STATUS "Check for signal return type in <signal.h>")
TRY_COMPILE(CMAKE_TEST_SIGNAL_TYPE
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/cmake/TestSignalType.c
OUTPUT_VARIABLE OUTPUT)
IF (CMAKE_TEST_SIGNAL_TYPE)
MESSAGE(STATUS "Check for signal handler return type type void - found")
SET (RETSIGTYPE void CACHE INTERNAL
"Signal return type")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Determining if signal handler return type is void passed with "
"the following output:\n${OUTPUT}\n\n")
ELSE (CMAKE_TEST_SIGNAL_TYPE)
MESSAGE(STATUS "Check for signal handler return type type void - not found")
SET (RETSIGTYPE int CACHE INTERNAL
"Signal return type")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Determining if signal handler return type is void failed with "
"the following output:\n${OUTPUT}\n\n")
ENDIF (CMAKE_TEST_SIGNAL_TYPE)
ENDIF(NOT DEFINED CMAKE_TEST_SIGNAL_TYPE)

148
cmake/x.cmake Normal file
View File

@@ -0,0 +1,148 @@
#include <dirent.h>
check_symbol_exists( opendir HAVE_OPENDIR )
# locale.h
check_symbol_exists( localeconv HAVE_LOCALECONV )
check_symbol_exists( setlocale HAVE_SETLOCALE )
#include <mach-o/dyld.h>
check_symbol_exists( NSLinkModule HAVE_NSLINKMODULE )
#include <malloc.h>
check_symbol_exists( mallinfo HAVE_MALLINFO )
#math.h
check_symbol_exists( acosh math.h HAVE_ACOSH )
check_symbol_exists( asinh math.h HAVE_ASINH )
check_symbol_exists( atanh math.h HAVE_ATANH )
check_symbol_exists( erf math.h HAVE_ERF )
check_symbol_exists( finite math.h HAVE_FINITE )
check_symbol_exists( ftruncate HAVE_FTRUNCATE )
check_symbol_exists( isfinite math.h HAVE_ISFINITE )
check_symbol_exists( lgamma math.h HAVE_LGAMMA )
check_symbol_exists( rint math.h AVE_RINT )
#include <netdb.h>
check_symbol_exists( h_errno HAVE_H_ERRNO )
check_symbol_exists( socklen_t HAVE_SOCKLEN_T ))
#include <regex.h>
check_symbol_exists( regexec HAVE_REGEXEC )
#include <setjmp.h>
check_symbol_exists( sigsetjmp HAVE_SIGSETJMP )
check_symbol_exists( __sigsetjmp HAVE__SIGSETJMP )
if(HAVE___SIGSETJMP)
set(HAVE_SIGSETJMP 1)
endif(HAVE___SIGSETJMP)
#include <signal.h>
check_symbol_exists( siggetmask HAVE_SIGGETMASK )
check_symbol_exists( SIGFPE HAVE_SIGFPE )
check_symbol_exists( SIGINFO HAVE_SIGINFO )
check_symbol_exists( SIGPROF HAVE_SIGPROF )
check_symbol_exists( SIGSEGV HAVE_SIGSEGV )
#include <stdbool.h>
check_symbol_exists( _bool HAVE__BOOL )
#include <stdio.h>
check_symbol_exists( popen HAVE_POPEN )
check_symbol_exists( rename HAVE_RENAME )
check_symbol_exists( setbuf HAVE_SETBUF )
check_symbol_exists( setlinebuf HAVE_SETLINEBUF )
check_symbol_exists( snprintf HAVE_SNPRINTF )
check_symbol_exists( tmpnam HAVE_TMPNAM )
check_symbol_exists( vsnprintf HAVE_VSNPRINTF )
#string.h
check_symbol_exists( memcpy HAVE_MEMCPY )
check_symbol_exists( memmove HAVE_MEMMOVE )
check_symbol_exists( strcasestr HAVE_STRCASESTR )
check_symbol_exists( strerror HAVE_STRERROR )
check_symbol_exists( strncat HAVE_STRNCAT )
check_symbol_exists( strncpy HAVE_STRNCPY )
check_symbol_exists( strnlen HAVE_STRNLEN )
check_symbol_exists( strchr HAVE_STRCHR )
check_symbol_exists( strlwr HAVE_STRLWR )
#include strings.h
check_symbol_exists( strncasecmp HAVE_STRNCASECMP )
#include <sys/shm.h>
check_symbol_exists( mmap HAVE_MMAP )
# sys/resource
check_symbol_exists( getrusage sys/resource HAVE_GETRUSAGE )
#include <sys/select.h>
check_symbol_exists( select HAVE_SELECT )
#include <sys/shm.h>
check_symbol_exists( shmat HAVE_SHMAT )
#include <sys/socket.h>
check_symbol_exists( socket HAVE_SOCKET )
# sys/stat.h
check_symbol_exists( lstat HAVE_LSTAT )
check_symbol_exists( stat HAVE_STAT )
#include <sys/time.h>
check_symbol_exists( gettimeofday HAVE_GETTIMEOFDAY )
#include <sys/times.h>
check_symbol_exists( times HAVE_TIMES )
#include <sys/types.h>
check_symbol_exists( ssize_t HAVE_SSIZE_T )
#include <sys/wait.h>
ocheck_symbol_exists( waitpid HAVE_WAITPID )
# time.h
check_symbol_exists( localtime HAVE_LOCALTIME )
check_symbol_exists( nanosleep HAVE_NANOSLEEP )
check_symbol_exists( setitimer HAVE_SETITIMER )
check_symbol_exists( timegm HAVE_TIMEGM )
# unistd.h
check_symbol_exists( access unistd.h HAVE_ACCESS )
check_symbol_exists( alarm unistd.h HAVE_ALARM )
check_symbol_exists( chdir unistd.h HAVE_CHDIR )
check_symbol_exists( crypt unistd.h HAVE_CRYPT )
check_symbol_exists( dup2 unistd.h HAVE_DUP2 )
check_symbol_exists( getcwd unistd.h HAVE_GETCWD )
check_symbol_exists( gethostid unistd.h HAVE_GETHOSTID )
check_symbol_exists( gethostname unistd.h HAVE_GETHOSTNAME )
check_symbol_exists( getpagesize unistd.h HAVE_GETPAGESIZE)
check_symbol_exists( pipe2 unistd.h HAVE_PIPE2 )
check_symbol_exists( sbrk unistd.h HAVE_SBRK )
#include <utime.h>
check_symbol_exists( utime HAVE_UTIME )
#include <wchar.h>
check_symbol_exists( wcsdup HAVE_WCSDUP )
check_symbol_exists( wcsnlen HAVE_WCSNLEN )
#windows.h
check_symbol_exists( LoadLibrary HAVE_LOADLIBRARY )
check_symbol_exists( mbscasecoll HAVE_MBSCASECOLL )
check_symbol_exists( mbscoll HAVE_MBSCOLL )
check_symbol_exists( mbsnrtowcs HAVE_MBSNRTOWCS )
check_symbol_exists( stricmp HAVE_STRICMP )
check_symbol_exists( nullptr HAVE_NULLPTR )
check_symbol_exists( sqllen HAVE_SQLLEN )
check_symbol_exists( sqlulen HAVE_SQLULEN )
check_symbol_exists( struct_time_tm_gmtoff HAVE_STRUCT_TIME_TM_GMTOFF )
check_symbol_exists( var_timezone HAVE_VAR_TIMEZONE )
check_symbol_exists( _chsize_s HAVE__CHSIZE_S )
check_symbol_exists( _NSGetEnviron HAVE__NSGETENVIRON )
check_symbol_exists( __builtin_ffsll HAVE___BUILTIN_FFSLL )