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

@ -2982,7 +2982,9 @@ Yap_absmi(int inp)
PELOCK(5, ((PredEntry *)(PREG->y_u.Otapl.p)));
PREG = (yamop *)(&(((PredEntry *)(PREG->y_u.Otapl.p))->OpcodeOfPred));
UNLOCKPE(11,(PredEntry *)(PREG->y_u.Otapl.p));
saveregs();
spy_goal( PASS_REGS1 );
setregs();
ENDBOp();
/* try_and_mark Label,NArgs */

View File

@ -341,15 +341,11 @@
#include "Foreign.h"
#include "attvar.h"
#include "SWI-Stream.h"
#include <stdlib.h>
#include <string.h>
#if HAVE_STDARG_H
#include <stdarg.h>
#endif
#if HAVE_STDINT_H
#include <stdint.h>
#endif
#if HAVE_STRING_H
#include <string.h>
#endif
#if _MSC_VER || defined(__MINGW32__)
#include <windows.h>
#endif

View File

@ -858,8 +858,9 @@ char *
Yap_TermToString(Term t, char *s, size_t sz, size_t *length, int *encoding, int flags)
{
CACHE_REGS
Int l, CurSlot;
Int l, CurSlot;
Int myASP = LCL0-ASP;
CurSlot = Yap_StartSlots( PASS_REGS1 );
l = Yap_InitSlot(t PASS_REGS );
@ -898,12 +899,17 @@ Yap_TermToString(Term t, char *s, size_t sz, size_t *length, int *encoding, int
/* found, just check if using local space */
if (r == buf) {
char *bf = malloc(*length+1);
if (!bf)
if (!bf) {
LOCAL_CurSlot = CurSlot;
ASP = LCL0-myASP;
return NULL;
}
strncpy(bf,buf,*length+1);
r = bf;
}
return r;
LOCAL_CurSlot = CurSlot;
ASP = LCL0-myASP;
return r;
} else
{ Sclose(fd);
}
@ -914,6 +920,7 @@ Yap_TermToString(Term t, char *s, size_t sz, size_t *length, int *encoding, int
}
}
LOCAL_CurSlot = CurSlot;
ASP = LCL0-myASP;
return NULL;
}

View File

@ -935,6 +935,7 @@ static Int init_current_predicate(USES_REGS1) {
else
cut_fail();
}
return FALSE;
} else if (IsPairTerm(t3)) {
f = FunctorDot;
at = AtomDot;

View File

@ -158,7 +158,7 @@ is_directory(const char *FileName)
{
#ifdef __WINDOWS__
char s[YAP_FILENAME_MAX+1];
const char *s0 = FileName;
char *s0 = (char *)FileName;
char *s1 = s;
int ch;
@ -192,7 +192,7 @@ is_directory(const char *FileName)
} else if (ch == '/')
s1[-1] = '\\';
}
if (ExpandEnvironmentStrings(s, FileName, YAP_FILENAME_MAX) == 0)
if (ExpandEnvironmentStrings(s, (LPSTR)FileName, YAP_FILENAME_MAX) == 0)
return FALSE;
DWORD dwAtts = GetFileAttributes( FileName );
@ -1774,7 +1774,7 @@ TrueFileName (char *source, char *root, char *result, int in_lib, int expand_roo
{
CACHE_REGS
char *work;
char ares1[YAP_FILENAME_MAX];
char ares1[YAP_FILENAME_MAX+1];
result[0] = '\0';
if (strlen(source) >= YAP_FILENAME_MAX) {
@ -2703,17 +2703,32 @@ p_yap_home( USES_REGS1 ) {
static Int
p_yap_paths( USES_REGS1 ) {
Term out1, out2, out3;
if (strlen(DESTDIR)) {
out1 = MkAtomTerm(Yap_LookupAtom(DESTDIR "/" YAP_LIBDIR));
out2 = MkAtomTerm(Yap_LookupAtom(DESTDIR "/" YAP_SHAREDIR));
out3 = MkAtomTerm(Yap_LookupAtom(DESTDIR "/" YAP_BINDIR));
const char *env_destdir = getenv("DESTDIR");
char destdir[YAP_FILENAME_MAX+1];
if (env_destdir) {
strncat(destdir, env_destdir, YAP_FILENAME_MAX );
strncat(destdir, "/" YAP_LIBDIR, YAP_FILENAME_MAX );
out1 = MkAtomTerm(Yap_LookupAtom(destdir));
} else {
out1 = MkAtomTerm(Yap_LookupAtom(YAP_LIBDIR));
}
if (env_destdir) {
strncat(destdir, env_destdir, YAP_FILENAME_MAX );
strncat(destdir, "/" YAP_SHAREDIR, YAP_FILENAME_MAX );
out2 = MkAtomTerm(Yap_LookupAtom(destdir));
} else {
#if __ANDROID__
out2 = MkAtomTerm(Yap_LookupAtom("/assets/share"));
#else
out2 = MkAtomTerm(Yap_LookupAtom(YAP_SHAREDIR));
#endif
}
if (env_destdir) {
strncat(destdir, env_destdir, YAP_FILENAME_MAX );
strncat(destdir, "/" YAP_BINDIR, YAP_FILENAME_MAX );
out3 = MkAtomTerm(Yap_LookupAtom(destdir));
} else {
out3 = MkAtomTerm(Yap_LookupAtom(YAP_BINDIR));
}
return(Yap_unify(out1,ARG1) &&

View File

@ -35,6 +35,12 @@
#if HAVE_STRING_H
#include <string.h>
#endif
#if HAVE_ERRNO_H
#include <errno.h>
#endif
#if HAVE_DIRECT_H
#include <direct.h>
#endif
void YAP_SetOutputMessage(void);
int YAP_parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap);
@ -459,8 +465,49 @@ YAP_parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
break;
}
break;
case 'p':
if ((*argv)[0] == '\0')
case '-':
if (!strcmp("-nosignals", p)) {
iap->PrologShouldHandleInterrupts = FALSE;
break;
} else if (!strncmp("-home=",p,strlen("-home="))) {
GLOBAL_Home = p+strlen("-home=");
} else if (!strncmp("-cwd=",p,strlen("-cwd="))) {
#if __WINDOWS__
if (_chdir( p+strlen("-cwd=") ) < 0) {
#else
if (chdir( p+strlen("-cwd=") ) < 0) {
#endif
fprintf(stderr," [ YAP unrecoverable error in setting cwd: %s ]\n", strerror(errno));
}
} else if (!strncmp("-stack=",p,strlen("-stack="))) {
ssize = &(iap->StackSize);
p+=strlen("-stack=");
goto GetSize;
} else if (!strncmp("-trail=",p,strlen("-trail="))) {
ssize = &(iap->TrailSize);
p+=strlen("-trail=");
goto GetSize;
} else if (!strncmp("-heap=",p,strlen("-heap="))) {
ssize = &(iap->HeapSize);
p+=strlen("-heap=");
goto GetSize;
} else if (!strncmp("-goal=",p,strlen("-goal="))) {
iap->YapPrologGoal = p+strlen("-goal=");
} else if (!strncmp("-top-level=",p,strlen("-top-level="))) {
iap->YapPrologTopLevelGoal = p+strlen("-top-level=");
} else if (!strncmp("-table=",p,strlen("-table="))) {
ssize = &(iap->MaxTableSpaceSize);
p +=strlen( "-table=");
goto GetSize;
} else if (!strncmp("-",p,strlen("-="))) {
ssize = &(iap->MaxTableSpaceSize);
p +=strlen( "-table=");
/* skip remaining arguments */
argc = 1;
}
break;
case 'p':
if ((*argv)[0] == '\0')
iap->YapPrologAddPath = *argv;
else {
argc--;
@ -494,10 +541,6 @@ YAP_parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
break;
}
/* End preprocessor code */
case '-':
/* skip remaining arguments */
argc = 1;
break;
default:
{
fprintf(stderr,"[ YAP unrecoverable error: unknown switch -%c ]\n", *p);

604
CMakeLists.txt Normal file
View File

@ -0,0 +1,604 @@
cmake_minimum_required(VERSION 2.8)
project(YAP C CXX)
set(YAP_MAJOR_VERSION 6)
set(YAP_MINOR_VERSION 3)
set(YAP_PATCH_VERSION 4)
set(YAP_FULL_VERSION
${YAP_MAJOR_VERSION}.${YAP_MINOR_VERSION}.${YAP_PATCH_VERSION})
set(YAP_NUMERIC_VERSION
${YAP_MAJOR_VERSION}*10000+${YAP_MINOR_VERSION}100+${YAP_PATCH_VERSION})
set(MYDDAS_VERSION MYDDAS-0.9.1)
message(STATUS "Building YAP version ${YAP_VERSION}")
# set path to additional CMake modules
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build})
set(YAP_PL_SRCDIR ${CMAKE_SOURCE_DIR}/pl)
# Compatibility vars with autotols
set ( prefix "${CMAKE_INSTALL_PREFIX}")
set ( exec_prefix "${prefix}")
set ( libdir "${exec_prefix}/lib")
set ( dlls "${exec_prefix}/lib/Yap")
set ( includedir "${prefix}/include")
set ( datarootdir "${prefix}/share")
set ( libpl "${prefix}/share")
set ( datadir "${datarootdir}")
set ( mandir "${datarootdir}/man")
set ( bindir "${exec_prefix}/bin")
set(YAP_ROOTDIR ${prefix})
set(YAP_SHAREDIR ${datarootdir})
set ( _GNU_SOURCE 1 )
if (WIN32)
set (YAP_ARCH $ENV{PROCESSOR_ARCHITECTURE})
endif()
if (UNIX)
find_program (UNAME uname)
execute_process (
COMMAND ${UNAME} -m
OUTPUT_VARIABLE YAP_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE )
endif()
# erootdir -> rootdir
# bindir defined above
# libdir defined above
set(YAPLIBDIR "${libdir}/Yap")
# Compilation Flags
if (CMAKE_COMPILER_IS_GNUCC)
message(STATUS "Original CMAKE_C_FLAGS ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wstrict-prototypes -Wmissing-prototypes")
message(STATUS "Running with CMAKE_C_FLAGS ${CMAKE_C_FLAGS}")
message(STATUS "Original CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -O -g")
message(STATUS "Runing with CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}")
message(STATUS "Original CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3 -fomit-frame-pointer")
message(STATUS "Running with CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}")
endif()
add_definitions(-D_YAP_NOT_INSTALLED_=1 -DHAVE_CONFIG_H)
set(YAP_YAPLIB libYap.${CMAKE_SHARED_LIBRARY_SUFFIX})
set(YAP_STARTUP startup.yss)
set(YAP_TIMESTAMP string(TIMESTAMP _output "%d/%m/%Y"))
#
# Optional libraries that affect compilation
#
include (ConfigureChecks)
include (MacroOptionalAddSubdirectory)
include (MacroOptionalFindPackage)
include (MacroLogFeature)
#
# Optional Components
#
include (CMakeDependentOption)
include (CheckSymbolExists)
set ( USE_SYSTEM_MALLOC 1)
set ( MALLOC_T void *)
set ( USE_THREADED_CODE 1)
set ( MIN_STACKSPACE 1024*SIZEOF_INT_P )
set ( MIN_HEAPSPACE 2*1024*SIZEOF_INT_P )
set ( MIN_TRAILSPACE 512*SIZEOF_INT_P )
set ( DEF_STACKSPACE 1024*SIZEOF_INT_P )
set ( DEF_HEAPSPACE 2*1024*SIZEOF_INT_P )
set ( DEF_TRAILSPACE 512*SIZEOF_INT_P )
set ( HAVE_GCC 1 )
# option (WITH_RATIONAL_TREES "support infinite rational trees" ON)
add_definitions (-DRATIONAL_TREES=1)
# option (WITH_COROUTINING
# "support co-routining, attributed variables and constraints" ON)
add_definitions (-DCOROUTINING=1)
# if (WITH_RATIONAL_TREES and WITH_COROUTINING)
#TODO: install (cd LGPL/clp ; $(MAKE) install)
# endif (WITH_RATIONAL_TREES and WITH_COROUTINING)
# option (WITH_DEPTH_LIMIT
# "support depth-bound computation" ON)
add_definitions (-DDEPTH_LIMIT=1)
option (WITH_TABLING "Support tabling" ON)
if (WITH_TABLING)
#this depends on DEPTH_LIMIT define it after
#this macro should realy be in config.h or other like it
#and it is used across several files outside OPTYap
add_definitions (-DTABLING=1)
add_definitions (-DGC_NO_TAGS=1)
include_directories (OPTYap)
add_subdirectory (OPTYap)
endif(WITH_TABLING)
option (WITH_EAM "enable EAM (Extended Andorra Model)" OFF)
if (WITH_EAM)
#this macro should realy be in config.h or other like it
add_definitions (-DBEAM=1)
include_directories (BEAM)
add_subdirectory (BEAM)
set (EXTRALIBS ${EXTRALIBS} beam)
endif (WITH_EAM)
#TODO: option (or-parallelism)
# option (WITH_WAM_Profile
# "support low level profiling of abstract machine" OFF)
option (WITH_Low_Level_Tracer
"support for procedure-call tracing" OFF)
#TODO:
option (System_Threads
"support system threads" OFF)
#TODO:
option (WITH_Dynamic_BDD
"dynamic bdd library" OFF)
#TODO:
cmake_dependent_option (WITH_PThreadLocking
"use pthread locking primitives for internal locking" ON
System_Threads OFF)
#TODO:
include_directories (H include os ${CMAKE_CURRENT_BINARY_DIR})
#
# Arch checks
#
#include(ConfigureChecks)
include (Config)
macro_optional_find_package (GMP ON)
macro_log_feature (GMP_FOUND "libgmp"
"GNU Multiple Precision"
"http://gmplib.org")
if (GMP_FOUND)
include_directories (${GMP_INCLUDE_DIR})
set (EXTRALIBS ${EXTRALIBS} ${GMP_LIBRARIES})
#config.h needs this (TODO: change in code latter)
set (USE_GMP 1)
endif (GMP_FOUND)
set (CURSES_NEED_NCURSES TRUE)
macro_optional_find_package (Curses ON)
macro_log_feature (CURSES_FOUND "libncurses"
"NCurses Library"
"")
if (CURSES_FOUND)
include_directories (${CURSES_INCLUDE_DIR})
set (EXTRALIBS ${EXTRALIBS} ${CURSES_NCURSES_LIBRARY})
endif (CURSES_FOUND)
macro_optional_find_package (Readline OFF)
macro_log_feature (READLINE_FOUND "libreadline"
"GNU Readline Library (or similar)"
"http://www.gnu.org/software/readline")
if (READLINE_FOUND)
include_directories (${READLINE_INCLUDE_DIR})
set (EXTRALIBS ${EXTRALIBS} ${READLINE_LIBRARIES})
set (HAVE_READLINE_READLINE_H 1)
check_function_exists( add_history HAVE_ADD_HISTORY )
check_function_exists( rl_ HAVE_RL_DISCARD_ARGUMENT)
check_function_exists( rl_begin_undo_group HAVE_RL_BEGIN_UNDO_GROUP)
check_function_exists( rl_clear_pending_input HAVE_RL_CLEAR_PENDING_INPUT)
check_function_exists( rl_discard_argument HAVE_RL_DISCARD_ARGUMENT)
check_function_exists( rl_filename_completion_function HAVE_RL_FILENAME_COMPLETION_FUNCTION)
check_function_exists( rl_free_line_state HAVE_RL_FREE_LINE_STATE )
check_function_exists( rl_insert_close HAVE_RL_INSERT_CLOSE )
check_function_exists( rl_reset_after_signal HAVE_RL_RESET_AFTER_SIGNAL )
check_function_exists( rl_set_keyboard_input_timeout HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT )
check_function_exists( rl_set_prompt HAVE_RL_SET_PROMPT)
check_symbol_exists( rl_catch_signals readline/readline.h HAVE_DECL_RL_CATCH_SIGNALS_ )
check_symbol_exists( rl_completion_func_t readline/readline.h HAVE_DECL_RL_COMPLETION_FUNC_T_ )
check_symbol_exists( rl_done readline/readline.h HAVE_DECL_RL_DONE )
check_symbol_exists( rl_hook_func_t readline/readline.h HAVE_DECL_RL_HOOK_FUNC_T_ )
check_symbol_exists( rl_event_hook readline/readline.h HAVE_DECL_RL_EVENT_HOOK )
check_symbol_exists( rl_readline_state readline/readline.h HAVE_DECL_RL_READLINE_STATE )
endif (READLINE_FOUND)
macro_optional_find_package (Threads ON)
macro_log_feature (THREADS_FOUND "Threads Support"
"GNU Threads Library (or similar)"
"http://www.gnu.org/software/threads")
if (THREADS_FOUND)
#
# CMAKE_THREAD_LIBS_INIT - the thread library
# CMAKE_USE_SPROC_INIT - are we using sproc?
# CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
# CMAKE_USE_PTHREADS_INIT - are we using pthreads
# CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
#
# The following import target is created
#
# ::
#
# Threads::Threads
#
# For systems with multiple thread libraries, caller can set
#
# ::
#
# CMAKE_THREAD_PREFER_PTHREAD
#
# If the use of the -pthread compiler and linker flag is prefered then the
# caller can set
#
# ::
#
set( THREADS_PREFER_PTHREAD_FLAG 1)
check_function_exists( pthread_mutexattr_setkind_np HAVE_PTHREAD_MUTEXATTR_SETKIND_NP )
check_function_exists( pthread_mutexattr_settype HAVE_PTHREAD_MUTEXATTR_SETTYPE )
check_function_exists( pthread_setconcurrency HAVE_PTHREAD_SETCONCURRENCY )
#
# Please note that the compiler flag can only be used with the imported
# target. Use of both the imported target as well as this switch is highly
# recommended for new code.
endif (THREADS_FOUND)
macro_optional_add_subdirectory (library)
add_subdirectory (docs)
macro_optional_add_subdirectory (packages/swig)
macro_optional_add_subdirectory (packages/myddas)
macro_optional_add_subdirectory (packages/gecode)
macro_optional_add_subdirectory (packages/real)
macro_optional_add_subdirectory (packages/python)
macro_optional_add_subdirectory (packages/cuda)
macro_optional_add_subdirectory (packages/archive)
macro_optional_add_subdirectory (packages/jpl)
macro_optional_add_subdirectory (packages/prosqlite)
macro_optional_add_subdirectory (packages/zlib)
#todo: use cmake target builds
# option (MAXPERFORMANCE
# "try using the best flags for specific architecture" OFF)
# option (MAXMEMORY
# "try using the best flags for using the memory to the most" ON)
#TODO: check MAXMEMORY
#TODO: use cmake target builds
# option (DEBUGYAP
# "enable C-debugging for YAP" OFF)
#TODO: use cmake arch/compiler
# option (CYGWIN
# "use cygwin library in WIN32" OFF)
option (WITH_PRISM
"use PRISM system in YAP" ON)
#TODO:
option (WITH_Dynamic_Loading
"compile YAP as a DLL" ON)
#TODO:
option (WITH_Static_compilation
"compile YAP statically" OFF)
#TODO:
option (Use_MALLOC
"use malloc to allocate memory" ON)
#TODO:
option(CONDOR
"allow YAP to be used from condor" OFF)
#TODO:
#TODO: detect arch before allow this option
# OPTION(WIN64
# "compile YAP for win64" OFF)
# option (WITH_APRIL
# "compile Yap to support April ILP system" OFF)
# option (DLCOMPAT
# "use dlcompat library for dynamic loading on Mac OS X" OFF)
# find_package(R)
# if (R_FOUND)
# MESSAGE(STATUS "RFOUND ${R_LIBRARIES} ${R_DEFINITIONS} ${R_EXECUTABLE}")
# endif (R_FOUND)
#TODO: check REAL_TARGET ENABLE_REAL
#TODO: Switch to feature detection
# OPTION(CHR
# "install chr library" ON)
# OPTION(CLPQR
# "install clpqr library" ON)
# OPTION(CPLINT
# "enable the cplint library using the CUDD library in DIR/lib" OFF)
# OPTION(yap_cv_clpbn_bp
# "enable belief propagation solver in CLPBN." OFF)
# OPTION(
# SHARED PACKAGES with SWI
# swi packages have both Makefile.in which we will use and
# Makefile.mak, we will use the later to identify this packages
# while we keep both autotools amd cmake working side by side
# Search for available packages which all have a Makefile.mak
#file (GLOB PACKAGES packages/*/Makefile.mak)
# needed by this packages
#configure_file(packages/Makefile.defs.cmake packages/Makefile.defs)
#configure_file(packages/Dialect.defs.cmake packages/Dialect.defs)
#
# Sources Section
#
set(IOLIB_SOURCES
os/pl-buffer.c
os/pl-codelist.c
os/pl-ctype.c
os/pl-dtoa.c
os/pl-error.c
os/pl-file.c
os/pl-files.c
os/pl-fmt.c
os/pl-glob.c
os/pl-option.c
os/pl-nt.c
os/pl-os.c
os/pl-privitf.c
os/pl-prologflag.c
os/pl-read.c
os/pl-rl.c
os/pl-stream.c
os/pl-string.c
os/pl-table.c
os/pl-tai.c
os/pl-text.c
os/pl-utf8.c
os/pl-write.c
C/pl-yap.c
)
if (WIN32)
set(IOLIBS_SOURCES
${IOLIBS_SOURCES}
os/windows/uxnt.c
)
endif (WIN32)
set (ENGINE_SOURCES
C/agc.c
C/absmi.c
C/adtdefs.c
C/alloc.c
C/amasm.c
C/analyst.c
C/arrays.c
C/arith0.c
C/arith1.c
C/arith2.c
C/atomic.c
C/attvar.c
C/bignum.c
C/bb.c
C/cdmgr.c
C/cmppreds.c
C/compiler.c
C/computils.c
C/corout.c
C/cut_c.c
C/dbase.c
C/dlmalloc.c
C/errors.c
C/eval.c
C/exec.c
C/exo.c
C/exo_udi.c
C/globals.c
C/gmp_support.c
C/gprof.c
C/grow.c
C/heapgc.c
C/index.c
C/init.c
C/inlines.c
C/iopreds.c
C/depth_bound.c
C/mavar.c
C/modules.c
C/other.c
C/parser.c
C/qlyr.c
C/qlyw.c
C/range.c
C/save.c
C/scanner.c
C/signals.c
C/sort.c
C/stdpreds.c
C/sysbits.c
C/text.c
C/threads.c
C/tracer.c
C/unify.c
C/userpreds.c
C/utilpreds.c
C/yap-args.c
C/write.c
C/ypstdio.c
library/dialect/swi/fli/swi.c
library/dialect/swi/fli/blobs.c
C/udi.c
#packages/udi/rtree.c
#packages/udi/rtree_udi.c
# ${IOLIB_SOURCES}
# MPI_SOURCES
)
set(LIBTAI_SOURCES
os/libtai/tai_add.c
os/libtai/tai_now.c
os/libtai/tai_pack.c
os/libtai/tai_sub.c
os/libtai/tai_unpack.c
os/libtai/taia_add.c
os/libtai/taia_approx.c
os/libtai/taia_fmtfrac.c
os/libtai/taia_frac.c
os/libtai/taia_half.c
os/libtai/taia_less.c
os/libtai/taia_now.c
os/libtai/taia_pack.c
os/libtai/taia_sub.c
os/libtai/taia_tai.c
os/libtai/taia_unpack.c
os/libtai/caldate_fmt.c
os/libtai/caldate_scan.c
os/libtai/caldate_fmjd.c
os/libtai/caldate_mjd.c
os/libtai/caldate_norm.c
os/libtai/caldate_ster.c
os/libtai/leapsecs_read.c
os/libtai/leapsecs_init.c
os/libtai/leapsecs_add.c
os/libtai/leapsecs_sub.c
os/libtai/caltime_fmt.c
os/libtai/caltime_scan.c
os/libtai/caltime_tai.c
os/libtai/caltime_utc.c
)
set(C_INTERFACE_SOURCES
C/load_foreign.c
C/load_dl.c
C/load_dld.c
C/load_dyld.c
C/load_none.c
C/load_aout.c
C/load_aix.c
C/load_dll.c
C/load_shl.c
C/c_interface.c
C/clause_list.c
)
SET(OPTYAP_SOURCES
OPTYap/or.memory.c
OPTYap/opt.init.c
OPTYap/opt.preds.c
OPTYap/or.copy_engine.c
OPTYap/or.cow_engine.c
OPTYap/or.sba_engine.c
OPTYap/or.thread_engine.c
OPTYap/or.scheduler.c
OPTYap/or.cut.c
OPTYap/tab.tries.c
OPTYap/tab.completion.c
)
set(STATIC_SOURCES
#NOT INCLUDED FOR NOW
)
set(CONSOLE_SOURCES console/yap.c)
#MPI STUFF
# library/mpi/mpi.c library/mpi/mpe.c
# library/lammpi/yap_mpi.c library/lammpi/hash.c library/lammpi/prologterms2c.c
# )
#WIN STUFF
# SET(PLCONS_SOURCES
# console/LGPL/pl-nt.c
# console/LGPL/pl-ntcon.c
# console/LGPL/pl-ntconsole.c
# console/LGPL/pl-ntmain.c
# )
# ADD_SUBDIRECTORY(GPL)
# ADD_SUBDIRECTORY(LGPL)
# ADD_SUBDIRECTORY(library)
# ADD_SUBDIRECTORY(os)
# ADD_SUBDIRECTORY(packages)
#
# include subdirecetories configuration
## after we have all functionality in
#
add_subdirectory (H)
configure_file ("${PROJECT_SOURCE_DIR}/config.h.cmake"
"${PROJECT_BINARY_DIR}/config.h" )
configure_file ("${PROJECT_SOURCE_DIR}/YapTermConfig.h.cmake"
"${PROJECT_BINARY_DIR}/YapTermConfig.h" )
add_library(libYap SHARED
${ENGINE_SOURCES}
${IOLIB_SOURCES}
${C_INTERFACE_SOURCES}
${STATIC_SOURCES}
${OPTYAP_SOURCES}
${LIBTAI_SOURCES})
target_link_libraries(libYap
m resolv stdc++ ${EXTRALIBS} )
set_target_properties(libYap
PROPERTIES INSTALL_RPATH ${libdir} VERSION ${YAP_FULL_VERSION} SOVERSION ${YAP_MAJOR_VERSION}.${YAP_MINOR_VERSION}
)
add_executable (yap-bin ${CONSOLE_SOURCES})
set_target_properties (yap-bin PROPERTIES OUTPUT_NAME yap depends libYap)
target_link_libraries(yap-bin libYap )
#add_custom_target (main ALL DEPENDS ${YAP_STARTUP} ) # WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )
#add_custom_command (TARGET ${YAP_STARTUP}
# COMMAND yap-bin -b ${CMAKE_SOURCE_DIR}/pl/boot.yap < /usr/bin/echo "bootstrap -- ${CMAKE_SOURCE_DIR}/pl/init.yap"
# DEPENDS yap-bin
#ß )
# if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# set(ORIGINAL_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "Default prefix path" FORCE)
# endif()
# mark_as_advanced(ORIGINAL_INSTALL_PREFIX)
# if( not( YAP_VERSION VERSION_EQUAL PROJECT_VERSION) )
# set(CMAKE_INSTALL_PREFIX "${ORIGINAL_INSTALL_PREFIX}-${VERSION}" CACHE STRING "Install path" FORCE)
# set(PROJECT_VERSION ${YAP_VERSION})
# endif()
install (
TARGETS yap-bin libYap
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
macro_display_feature_log()

0
H/CMakeLists.txt Normal file
View File

View File

@ -130,4 +130,5 @@
#define GLOBAL_mutex_backbone Yap_global->mutex_backbone_
#define GLOBAL_MUT_ACCESS Yap_global->MUT_ACCESS_
#endif
#define GLOBAL_Home Yap_global->Home_

View File

@ -130,4 +130,5 @@ typedef struct global_data {
struct swi_mutex* mutex_backbone_;
lockvar MUT_ACCESS_;
#endif
char* Home_;
} w_shared;

View File

@ -130,4 +130,5 @@ static void InitGlobal(void) {
GLOBAL_mutex_backbone = NULL;
INIT_LOCK(GLOBAL_MUT_ACCESS);
#endif
GLOBAL_Home = NULL;
}

View File

@ -130,4 +130,5 @@ static void RestoreGlobal(void) {
REINIT_LOCK(GLOBAL_MUT_ACCESS);
#endif
}

0
OPTYap/CMakeLists.txt Normal file
View File

23
YapTermConfig.h.cmake Normal file
View File

@ -0,0 +1,23 @@
#ifndef YAP_TERM_CONFIG
#define YAP_TERM_CONFIG 1
/* Define sizes of some basic types */
#undef SIZEOF_INT_P
#undef SIZEOF_INT
#undef SIZEOF_SHORT_INT
#undef SIZEOF_LONG_INT
#undef SIZEOF_LONG_LONG_INT
#undef SIZEOF_FLOAT
#undef SIZEOF_DOUBLE
#ifndef HAVE_INTTYPES_H
#undef HAVE_INTTYPES_H
#endif
#ifndef HAVE_STDINT_H
#undef HAVE_STDINT_H
#endif
#endif

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 )

1985
config.h.cmake Normal file

File diff suppressed because it is too large Load Diff

18
configure vendored
View File

@ -6260,9 +6260,7 @@ _ACEOF
fi
yap_cv_readline=no
if test "$prefix" = "NONE"
then
#mingw64
#mingw64??
case "$build_os" in
*linux*)
if test "${WINEPREFIX}x" = x
@ -6273,12 +6271,13 @@ fi
fi
if test "$target_cpu" = "x86_64"
then
prefix="$SYSTEMDRIVE/Yap64"
PRE_INSTALL_ENV="wine64"
prefix="$SYSTEMDRIVE/Yap64"
else
PRE_INSTALL_ENV="wine"
prefix="$SYSTEMDRIVE/Yap"
fi
i_am_cross_compiling=yes
PRE_INSTALL_ENV="wine "
;;
**)
if test "$target_cpu" = "x86_64"
@ -6289,7 +6288,6 @@ fi
fi
;;
esac
fi
WINDOWS=""
PKG_WINCONSOLE="swi/console"
else
@ -14091,7 +14089,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 14094 "configure" */
/* #line 14092 "configure" */
public class Test {
}
EOF
@ -14267,7 +14265,7 @@ EOF
if uudecode$EXEEXT Test.uue; then
ac_cv_prog_uudecode_base64=yes
else
echo "configure: 14270: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: 14268: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: failed file was:" >&5
cat Test.uue >&5
ac_cv_prog_uudecode_base64=no
@ -14398,7 +14396,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 14401 "configure" */
/* #line 14399 "configure" */
public class Test {
}
EOF
@ -14433,7 +14431,7 @@ JAVA_TEST=Test.java
CLASS_TEST=Test.class
TEST=Test
cat << \EOF > $JAVA_TEST
/* [#]line 14436 "configure" */
/* [#]line 14434 "configure" */
public class Test {
public static void main (String args[]) {
System.exit (0);

View File

@ -636,9 +636,7 @@ then
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll $EXTRA_LIBS_FOR_DLLS"
AC_CHECK_LIB(psapi,main)
yap_cv_readline=no
if test "$prefix" = "NONE"
then
#mingw64
#mingw64??
case "$build_os" in
*linux*)
if test "${WINEPREFIX}x" = x
@ -649,12 +647,13 @@ then
fi
if test "$target_cpu" = "x86_64"
then
prefix="$SYSTEMDRIVE/Yap64"
PRE_INSTALL_ENV="wine64"
prefix="$SYSTEMDRIVE/Yap64"
else
PRE_INSTALL_ENV="wine"
prefix="$SYSTEMDRIVE/Yap"
fi
i_am_cross_compiling=yes
PRE_INSTALL_ENV="wine "
;;
**)
if test "$target_cpu" = "x86_64"
@ -665,7 +664,6 @@ then
fi
;;
esac
fi
WINDOWS=""
PKG_WINCONSOLE="swi/console"
else

18
docs/CMakeLists.txt Normal file
View File

@ -0,0 +1,18 @@
#CHECK: DOXYGEN
macro_optional_find_package (Doxygen ON)
macro_log_feature (DOXYGEN_FOUND "Doxygen"
"Use DOXYGEN Documentation System "
"http://www.doxygen.org" FALSE)
if (DOXYGEN_FOUND)
#
# DOXYGEN_EXECUTABLE = The path to the doxygen command.
# DOXYGEN_FOUND = Was Doxygen found or not?
# DOXYGEN_VERSION = The version reported by doxygen --version
#
#
#
# ::
#
# DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
# DOXYGEN_DOT_FOUND = Was Dot found or not?
endif (DOXYGEN_FOUND)

9
library/CMakeLists.txt Normal file
View File

@ -0,0 +1,9 @@
add_subdirectory(lammpi)
add_subdirectory(matlab)
add_subdirectory(matrix)
add_subdirectory(mpi)
add_subdirectory(random)
add_subdirectory(regex)
add_subdirectory(rltree)
add_subdirectory(system)
add_subdirectory(tries)

View File

@ -0,0 +1,31 @@
macro_optional_find_package (MPI OFF)
macro_log_feature (MPI_C_FOUND "mpi"
"MPI Distributed Parallel Programming"
"http://gmplib.org")
if (MPI_C_FOUND)
# This module will set the following variables per language in your
# project, where <lang> is one of C, CXX, or Fortran:
#
# ::
#
# MPI_<lang>_FOUND TRUE if FindMPI found MPI flags for <lang>
# MPI_<lang>_COMPILER MPI Compiler wrapper for <lang>
# MPI_<lang>_COMPILE_FLAGS Compilation flags for MPI programs
# MPI_<lang>_INCLUDE_PATH Include path(s) for MPI header
# MPI_<lang>_LINK_FLAGS Linking flags for MPI programs
# MPI_<lang>_LIBRARIES All libraries to link MPI programs against
#
# Additionally, FindMPI sets the following variables for running MPI
# programs from the command line:
#
# ::
#
# MPIEXEC Executable for running MPI programs
# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving
# it the number of processors to run on
# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly
# before the executable to run.
# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags
#
endif (MPI_C_FOUND)

View File

@ -0,0 +1,12 @@
macro_optional_find_package (Matlab OFF)
macro_log_feature (MATLAB_FOUND "matlab"
"MATLAB Distributed Parallel Programming"
"http://matlab.com")
if (MATLAB_FOUND)
# MATLAB_INCLUDE_DIR: include path for mex.h, engine.h
# MATLAB_LIBRARIES: required libraries: libmex, etc
# MATLAB_MEX_LIBRARY: path to libmex.lib
# MATLAB_MX_LIBRARY: path to libmx.lib
# MATLAB_ENG_LIBRARY: path to libeng.lib
endif (MATLAB_FOUND)

View File

View File

View File

View File

View File

View File

View File

View File

@ -153,5 +153,8 @@ struct swi_mutex* mutex_backbone =NULL
lockvar MUT_ACCESS MkLock
#endif
char* Home =NULL
END_GLOBAL_DATA

View File

@ -51,11 +51,6 @@
#define INT64_T_DEFINED 1
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#if (_MSC_VER < 1300)
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef intptr_t ssize_t; /* signed version of size_t */
#endif
#endif
#else
#include <unistd.h>

View File

@ -1300,7 +1300,7 @@ setVersionPrologFlag(void)
setPrologFlag("version_data", FF_READONLY|FT_TERM, t);
PL_discard_foreign_frame(fid);
setGITVersion();
//setGITVersion();
}

@ -1 +1 @@
Subproject commit 87bb48410a5c5e9bc36abfde0e718b8bd3e99864
Subproject commit 3048749364240b506c2c9effba424028eea4ffa7

@ -1 +1 @@
Subproject commit dc25a433df1f77e6271179664080d338e10c9d6b
Subproject commit 55f1b0d765c607c99b9b9c67f150df64d33128b0

View File

@ -0,0 +1,52 @@
#CHECK: CUDA
macro_optional_find_package (CUDA ON)
macro_log_feature (CUDA_FOUND "CUDA"
"CUDA GGPU Programming "
"http://www.r.org" FALSE)
if (CUDA_FOUND)
# CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc.
# CUDA_VERSION_MINOR -- The minor version.
# CUDA_VERSION
# CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
#
# CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
# CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the
# SDK. This script will not directly support finding
# specific libraries or headers, as that isn't
# supported by NVIDIA. If you want to change
# libraries when the path changes see the
# FindCUDA.cmake script for an example of how to clear
# these variables. There are also examples of how to
# use the CUDA_SDK_ROOT_DIR to locate headers or
# libraries, if you so choose (at your own risk).
# CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically
# for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY.
# CUDA_LIBRARIES -- Cuda RT library.
# CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT
# implementation (alternative to:
# CUDA_ADD_CUFFT_TO_TARGET macro)
# CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS
# implementation (alterative to:
# CUDA_ADD_CUBLAS_TO_TARGET macro).
# CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library.
# Only available for CUDA version 4.0+.
# CUDA_curand_LIBRARY -- CUDA Random Number Generation library.
# Only available for CUDA version 3.2+.
# CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
# Only available for CUDA version 3.2+.
# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib.
# Only available for CUDA version 4.0+.
# CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core).
# Only available for CUDA version 5.5+.
# CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
# Only available for CUDA version 5.5+.
# CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing).
# Only available for CUDA version 5.5+.
# CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
# Only available for CUDA version 3.2+.
# Windows only.
# CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library.
# Only available for CUDA version 3.2+.
# Windows only.
endif (CUDA_FOUND)

View File

@ -0,0 +1,18 @@
#TODO: change macro_log_feature to check both WITH_{$name} and ${name}_FOUND
#TODO: improve FindGecode.cmake to be similar to other Find*.cmake
#CHECK: GECODE
macro_optional_find_package (Gecode ON)
macro_log_feature (GECODE_FOUND "libgecode"
"Use Generic Constraint Development Environment (GECODE) library"
"http://www.gecode.org" FALSE)
if (GECODE_FOUND)
#DEFINES:
# GECODE_INCLUDE_DIR
# GECODE_VERSION
# GECODE_LIBRARIES
#set (EXTRALIBS gecode)
#include_directories (${GECODE_INCLUDE_DIR})
#set (EXTRALIBS ${EXTRALIBS} ${GECODE_LIBRARIES})
endif (GECODE_FOUND)

View File

@ -0,0 +1,44 @@
macro_optional_find_package(ODBC ON)
if (ODBC_FOUND)
macro_log_feature (ODBC_FOUND "ODBC"
"Use ODBC Data-Base Interface "
"http://www.odbc.org" FALSE)
add_definitions (-DMYDDAS_ODBC=1)
set (EXTRALIBS ${EXTRALIBS} ${ODBC_LIBRARY})
if (APPLE)
set (EXTRALIBS ${EXTRALIBS} "-framework CoreFoundation")
endif (APPLE)
endif (ODBC_FOUND)
macro_optional_find_package(MySQL ON)
if (MYSQL_FOUND)
macro_log_feature (MYSQL_FOUND "MySQL"
"Use MYSQL Data-Base Interface "
"http://www.odbc.org" FALSE)
add_definitions (-DMYDDAS_MYSQL=1)
endif (MYSQL_FOUND)
option (WITH_MYDDAS
"enable the MYDDAS library" ON)
if (WITH_MYDDAS)
if (MYSQL_FOUND)
add_definitions (-DMYDDAS_MYSQL=1)
endif (MYSQL_FOUND)
if (MYSQL_FOUND OR ODBC_FOUND)
set (EXTRALIBS ${EXTRALIBS} myddas)
else (MYSQL_FOUND OR ODBC_FOUND)
message(SEND_ERROR "MYDDAS needs either MYSQL or ODBC none where found")
endif (MYSQL_FOUND OR ODBC_FOUND)
endif (WITH_MYDDAS)
cmake_dependent_option (WITH_MYDDAS_Stats
"enable the MYDDAS library statistics support" OFF
WITH_MYDDAS OFF)
#TODO:
cmake_dependent_option (WITH_MYDDAS_top_level
"enable the MYDDAS top-level support to MySQL" OFF
'WITH_MYDDAS AND MYSQL_FOUND' OFF)
#TODO:

View File

@ -0,0 +1,12 @@
macro_optional_find_package (Sqlite3 ON)
macro_log_feature (SQLITE3_FOUND "sqlite3"
"SQLITE3 Light Weight Database Manager"
"http://sqlite3.com")
if (SQLITE3_FOUND)
# 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)
endif (SQLITE3_FOUND)

View File

@ -0,0 +1,34 @@
#CHECK: PythonLibs
macro_optional_find_package(PythonInterp ON)
macro_optional_find_package (PythonLibs ON)
macro_log_feature (PYTHONLIBS_FOUND "Python"
"Use Python System"
"http://www.python.org" FALSE)
if (PYTHONLIBS_FOUND) # PYTHONLIBS_FOUND - have the Python libs been found
# PYTHON_LIBRARIES - path to the python library
# PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
# PYTHON_INCLUDE_DIRS - path to where Python.h is found
# PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated)
# PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8)
#
#
#
# The Python_ADDITIONAL_VERSIONS variable can be used to specify a list
# of version numbers that should be taken into account when searching
# for Python. You need to set this variable before calling
# find_package(PythonLibs).
#
# If you'd like to specify the installation of Python to use, you should
# modify the following cache variables:
#
# ::
#
# PYTHON_LIBRARY - path to the python library
# PYTHON_INCLUDE_DIR - path to where Python.h is found
#
# If also calling find_package(PythonInterp), call find_package(PythonInterp)
# first to get the currently active Python version by default with a consistent
# version of PYTHON_LIBRARIES.
endif (PYTHONLIBS_FOUND)

View File

@ -0,0 +1,16 @@
#CHECK: SWIG
macro_optional_find_package (SWIG ON)
macro_log_feature (SWIG_FOUND "Swig"
"Use SWIG Documentation System "
"http://www.swig.org" FALSE)
if (SWIG_FOUND)
#
# SWIG_FOUND - set to true if SWIG is found
# SWIG_DIR - the directory where swig is installed
# SWIG_EXECUTABLE - the path to the swig executable
# SWIG_VERSION - the version number of the swig executable
#
endif (SWIG_FOUND)

View File

@ -1308,6 +1308,12 @@ not(G) :- \+ '$execute'(G).
% -p option must be processed after initializing the system
'$swi_set_prolog_flag'(verbose_load, OldSilent).
bootstrap :-
'$argv'([F]),
bootstrap(F),
module(user),
qsave_program('startup.yss').
bootstrap(F) :-
% '$open'(F, '$csult', Stream, 0, 0, F),
% '$file_name'(Stream,File),
@ -1570,3 +1576,4 @@ log_event( String, Args ) :-
/**
@}
*/