~juan457/+junk/zorba

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# Copyright 2006-2008 The FLWOR Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# specify the standard configuration here
# 1. set the variable you want to use and assign it a default value
#    make sure you specify the datatype and the keyword CACHE to
#    tell cmake that it needs to store the value in its cache
# 2. print out a message showing the status of your variable
# 3. add your configuration parameter to include/zorba/config.h.cmake
#    for example for string variables use
#    #define ZORBA_BATCHING_TYPE    ${ZORBA_BATCHING_TYPE}
#    ${VARIABLE} is replaced by cmake using the value
#    that is set for this variable
#    for booleans (e.g. SET (ZORBA_VARIABLE OFF CACHE BOOL "zorba variable")), use
#    #cmakedefine VARIABLE
# 4. if you want to change your variable value, execute
#    cmake -DVARIABLE=new_value
#    the variable will keep this value (i.e. store it in the cache file CMakeCache.txt)
#    until you set a new one or edit the CMakeCache.txt file
#

SET(ZORBA_NATIVE_STORE ON CACHE BOOL "Choose zorba native store")
MESSAGE(STATUS "ZORBA_NATIVE_STORE:                   " ${ZORBA_NATIVE_STORE})

# Adding store srcs
IF(ZORBA_NATIVE_STORE)
  SET(ZORBA_STORE_DIR "${CMAKE_SOURCE_DIR}/src/store/naive" CACHE PATH "Path to the store directory. Must contain CMakeLists.txt defining the variable ZORBA_STORE_IMPL_SRCS.")
  SET(ZORBA_STORE_NAME "simplestore" CACHE STRING "Names of the stores. Must have be in sync with ZORBA_STORE_DIR")
ENDIF(ZORBA_NATIVE_STORE)

MESSAGE(STATUS "ZORBA_STORE_DIR:                     " ${ZORBA_STORE_DIR})
MESSAGE(STATUS "ZORBA_STORE_NAME:                    " ${ZORBA_STORE_NAME})

# how should batching in the runtime system be done
SET(ZORBA_BATCHING_TYPE 0 CACHE STRING
    "0 = NO_BATCHING, 1 = SIMPLE_BATCHING, 2 = SUPER_BATCHING")
MESSAGE(STATUS "ZORBA_BATCHING_TYPE:                  " ${ZORBA_BATCHING_TYPE})

# number of items to batch if ZORBA_BATCHING_TYPE is SIMPLE_BATCHING or SUPER_BATCHING
IF (ZORBA_BATCHING_TYPE GREATER 0)
    SET(ZORBA_BATCHING_BATCHSIZE 100 CACHE STRING
        "the batchsize used if batching is used")
    MESSAGE(STATUS "ZORBA_BATCHING_BATCHSIZE:             " ${ZORBA_BATCHING_BATCHSIZE})
ENDIF (ZORBA_BATCHING_TYPE GREATER 0)

# float point precision
SET(ZORBA_FLOAT_POINT_PRECISION 18 CACHE STRING
   "number of decimal places in floating point serialization")
MESSAGE(STATUS "ZORBA_FLOAT_POINT_PRECISION:          " ${ZORBA_FLOAT_POINT_PRECISION})

# code coverage information
SET(ZORBA_WITH_CODE_COVERAGE OFF CACHE BOOL "compile the code with information for a code coverage analysis")
MESSAGE(STATUS "ZORBA_WITH_CODE_COVERAGE:             " ${ZORBA_WITH_CODE_COVERAGE})

# code profile information
SET(ZORBA_WITH_CODE_PROFILE OFF CACHE BOOL "compile the code with information for a code profiling analysis")
MESSAGE(STATUS "ZORBA_WITH_CODE_PROFILE:              " ${ZORBA_WITH_CODE_PROFILE})

SET(ZORBA_FOR_ONE_THREAD_ONLY OFF CACHE BOOL "compile zorba for single threaded use")
MESSAGE(STATUS "ZORBA_FOR_ONE_THREAD_ONLY:            " ${ZORBA_FOR_ONE_THREAD_ONLY})

IF (DEFINED UNIX)
  IF (NOT DEFINED ZORBA_HAVE_PTHREAD_H AND NOT DEFINED ZORBA_FOR_ONE_THREAD_ONLY)
    MESSAGE(FATAL_ERROR "pthread is not available")
  ENDIF (NOT DEFINED ZORBA_HAVE_PTHREAD_H AND NOT DEFINED ZORBA_FOR_ONE_THREAD_ONLY)
ELSE (DEFINED UNIX)
  SET(ZORBA_WIN_PLATFORM "win32" CACHE STRING "win platform")
  MESSAGE(STATUS "ZORBA_WIN_PLATFORM [win32/pocketpc/smartphone]: " ${ZORBA_WIN_PLATFORM})
  IF("${ZORBA_WIN_PLATFORM}" STREQUAL "pocketpc" OR "${ZORBA_WIN_PLATFORM}" STREQUAL "smartphone")
    SET(WINCE ON)
    SET(WIN32 OFF)
  ENDIF("${ZORBA_WIN_PLATFORM}" STREQUAL "pocketpc" OR "${ZORBA_WIN_PLATFORM}" STREQUAL "smartphone")
ENDIF (DEFINED UNIX)

SET(ZORBA_WITH_FILE_ACCESS ON CACHE BOOL "compile zorba and allow loading documents from the filesystem")
MESSAGE(STATUS "ZORBA_WITH_FILE_ACCESS [ON/OFF]:      " ${ZORBA_WITH_FILE_ACCESS})

SET(ZORBA_WITH_DEBUGGER ON CACHE BOOL "compile zorba with debugger support")
MESSAGE(STATUS "ZORBA_WITH_DEBUGGER [ON/OFF]:         " ${ZORBA_WITH_DEBUGGER})

SET(ZORBA_TEST_TIMEOUT_VALUE 60 CACHE INTEGER "default test timeout value")
MESSAGE(STATUS "ZORBA_TEST_TIMEOUT_VALUE:             " ${ZORBA_TEST_TIMEOUT_VALUE})

SET(ZORBA_VERIFY_PEER_SSL_CERTIFICATE OFF CACHE BOOL "Disable root certificate validation")
MESSAGE(STATUS "ZORBA_VERIFY_PEER_SSL_CERTIFICATE:    " ${ZORBA_VERIFY_PEER_SSL_CERTIFICATE})

IF(${ZORBA_WITH_CODE_PROFILE})
  SET(ZORBA_BUILD_STATIC_LIBRARY ON CACHE BOOL "build a static library, e.g. when creating a profile")
ELSE(${ZORBA_WITH_CODE_PROFILE})
  SET(ZORBA_BUILD_STATIC_LIBRARY OFF CACHE BOOL "build a static library, e.g. when creating a release")
ENDIF(${ZORBA_WITH_CODE_PROFILE})
MESSAGE(STATUS "ZORBA_WITH_CODE_PROFILE:              " ${ZORBA_WITH_CODE_PROFILE})

MESSAGE(STATUS "ZORBA_BUILD_STATIC_LIBRARY:           " ${ZORBA_BUILD_STATIC_LIBRARY})

IF(MSVC AND NOT ZORBA_BUILD_STATIC_LIBRARY)
  SET(ZORBA_WIN_DLL ON)
ELSE (MSVC AND NOT ZORBA_BUILD_STATIC_LIBRARY)
  SET(ZORBA_WIN_DLL   OFF)
ENDIF (MSVC AND NOT ZORBA_BUILD_STATIC_LIBRARY)
MESSAGE(STATUS "ZORBA_WIN_DLL:                        " ${ZORBA_WIN_DLL})

# We need the path to the zorba executable because it will be used during the
# build to generate source code and documentation.
SET(ZORBA_EXE "${CMAKE_BINARY_DIR}/bin/zorba")
IF(WIN32)
  SET(ZORBA_EXE "${ZORBA_EXE}.bat")
ENDIF(WIN32)
SET(ZORBA_EXE ${ZORBA_EXE} CACHE STRING "executable used for generating the runtime")
MESSAGE(STATUS "ZORBA_EXE:                            " ${ZORBA_EXE})

# flags for debugging the parser
SET(ZORBA_DEBUG_PARSER OFF CACHE BOOL "debug the parser")
MESSAGE(STATUS "ZORBA_DEBUG_PARSER:                   " ${ZORBA_DEBUG_PARSER})

# if not set by the user, set ZORBA_DEBUG_STRING to ON for Debug and RelWithDebInfo builds
IF (NOT ZORBA_DEBUG_STRING)
  IF (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
    SET (ZORBA_DEBUG_STRING ON)
  ELSE (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
    SET (ZORBA_DEBUG_STRING OFF)
  ENDIF (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
ENDIF (NOT ZORBA_DEBUG_STRING)
SET (ZORBA_DEBUG_STRING ${ZORBA_DEBUG_STRING} CACHE BOOL "debug strings")
MESSAGE (STATUS "ZORBA_DEBUG_STRING:                   " ${ZORBA_DEBUG_STRING})

SET(ZORBA_NO_ICU OFF CACHE BOOL "disable ICU")
MESSAGE(STATUS "ZORBA_NO_ICU:                         " ${ZORBA_NO_ICU})

IF (ZORBA_NO_ICU)
  SET (no_full_text ON)
ELSE (ZORBA_NO_ICU)
  SET (no_full_text OFF)
ENDIF (ZORBA_NO_ICU)
SET (ZORBA_NO_FULL_TEXT ${no_full_text} CACHE BOOL "disable XQuery Full-Text support")
MESSAGE(STATUS "ZORBA_NO_FULL_TEXT:                   " ${ZORBA_NO_FULL_TEXT})

SET(ZORBA_NO_XMLSCHEMA OFF CACHE BOOL "disable XMLSchema support")
MESSAGE(STATUS "ZORBA_NO_XMLSCHEMA:                   " ${ZORBA_NO_XMLSCHEMA})

SET(ZORBA_WITH_BIG_INTEGER OFF CACHE BOOL "enable arbitrary precision integers")
MESSAGE(STATUS "ZORBA_WITH_BIG_INTEGER:               " ${ZORBA_WITH_BIG_INTEGER})

SET(ZORBA_WITH_JSON OFF CACHE BOOL "enable integrated JSON support")
MESSAGE(STATUS "ZORBA_WITH_JSON:                      " ${ZORBA_WITH_JSON})

IF (ZORBA_SUPPRESS_SWIG)
  SET (no_swig ON)
ELSE (ZORBA_SUPPRESS_SWIG)
  SET (no_swig OFF)
ENDIF (ZORBA_SUPPRESS_SWIG)
SET(ZORBA_SUPPRESS_SWIG ${no_swig} CACHE BOOL "use Swig to generate api for Python, Php and Ruby")
MESSAGE(STATUS "ZORBA_SUPPRESS_SWIG [ON/OFF]:         " ${no_swig})

SET(ZORBA_XQUERYX OFF CACHE BOOL "Activate capability to compile XQueryX code (on/off)")
MESSAGE(STATUS "ZORBA_XQUERYX:                        " ${ZORBA_XQUERYX})

SET(ZORBA_TEST_XQUERYX OFF CACHE BOOL "Test only xqueryx (.xqx) tests")
MESSAGE(STATUS "ZORBA_TEST_XQUERYX:                   " ${ZORBA_TEST_XQUERYX})
IF(ZORBA_TEST_XQUERYX)
  SET(ZORBA_XQUERYX ON CACHE BOOL "Activate capability to compile XQueryX code (on/off)" FORCE)
ENDIF(ZORBA_TEST_XQUERYX)

IF(WIN32)
  SET(CMAKE_SKIP_RPATH ON CACHE BOOL "The rpath information is not added to compiled executables")
  MESSAGE(STATUS "CMAKE_SKIP_RPATH:                     " ${CMAKE_SKIP_RPATH})
ENDIF(WIN32)

# below we print some variables you might be interested in, when compiling

# if you are building in-source, this is the same as CMAKE_SOURCE_DIR, otherwise
# this is the top level directory of your build tree
MESSAGE(STATUS "CMAKE_BINARY_DIR:                     " ${CMAKE_BINARY_DIR})

# this is the directory, from which cmake was started, i.e. the top level source directory
MESSAGE(STATUS "CMAKE_SOURCE_DIR:                     " ${CMAKE_SOURCE_DIR})

# the complete system name, e.g. "Linux-2.4.22", "FreeBSD-5.4-RELEASE" or "Windows 5.1"
MESSAGE(STATUS "CMAKE_SYSTEM:                         " ${CMAKE_SYSTEM})

# the short system name, e.g. "Linux", "FreeBSD" or "Windows"
MESSAGE(STATUS "CMAKE_SYSTEM_NAME:                    " ${CMAKE_SYSTEM_NAME})

# only the version part of CMAKE_SYSTEM
MESSAGE(STATUS "CMAKE_SYSTEM_VERSION:                 " ${CMAKE_SYSTEM_VERSION})

# the processor name (e.g. "Intel(R) Pentium(R) M processor 2.00GHz")
MESSAGE(STATUS "CMAKE_SYSTEM_PROCESSOR:               " ${CMAKE_SYSTEM_PROCESSOR})

# is TRUE on all UNIX-like OS's, including Apple OS X and CygWin
MESSAGE(STATUS "UNIX:                                 " ${UNIX})

# is TRUE on Windows, including CygWin
MESSAGE(STATUS "WIN32:                                " ${WIN32})

# is TRUE on Apple OS X
MESSAGE(STATUS "APPLE:                                " ${APPLE})

# is TRUE when using the MinGW compiler in Windows
MESSAGE(STATUS "MINGW:                                " ${MINGW})

# is TRUE on Windows when using the CygWin version of cmake
MESSAGE(STATUS "CYGWIN:                               " ${CYGWIN})

# is TRUE on Windows when using a Borland compiler
MESSAGE(STATUS "BORLAND:                              " ${BORLAND})

# Microsoft compiler
MESSAGE(STATUS "MSVC:                                 " ${MSVC})
MESSAGE(STATUS "MSVC_IDE:                             " ${MSVC_IDE})
MESSAGE(STATUS "MSVC60:                               " ${MSVC60})
MESSAGE(STATUS "MSVC70:                               " ${MSVC70})
MESSAGE(STATUS "MSVC71:                               " ${MSVC71})
MESSAGE(STATUS "MSVC80:                               " ${MSVC80})
MESSAGE(STATUS "CMAKE_COMPILER_2005:                  " ${CMAKE_COMPILER_2005})

# A simple way to get switches to the compiler is to use ADD_DEFINITIONS().
# But there are also two variables exactly for this purpose:

IF(${ZORBA_WITH_CODE_PROFILE})
  IF(APPLE)
    SET(CMAKE_C_FLAGS "-finstrument-functions -Wl,-lSaturn ${CMAKE_C_FLAGS}")
    SET(CMAKE_CXX_FLAGS "-finstrument-functions -Wl,-lSaturn ${CMAKE_CXX_FLAGS}")
  ELSE(APPLE)
    SET(CMAKE_C_FLAGS "-pg ${CMAKE_C_FLAGS}")
    SET(CMAKE_CXX_FLAGS "-pg ${CMAKE_CXX_FLAGS}")
  ENDIF(APPLE)
ENDIF(${ZORBA_WITH_CODE_PROFILE})

# the compiler flags for compiling C sources
MESSAGE(STATUS "CMAKE_C_FLAGS:                        " ${CMAKE_C_FLAGS})

# the compiler flags for compiling C++ sources
MESSAGE(STATUS "CMAKE_CXX_FLAGS:                      " ${CMAKE_CXX_FLAGS})

# choose the type of build.  Example: SET(CMAKE_BUILD_TYPE Debug)
MESSAGE(STATUS "CMAKE_BUILD_TYPE:                     " ${CMAKE_BUILD_TYPE})

# where will install commands place their output
MESSAGE(STATUS "CMAKE_INSTALL_PREFIX:                 " ${CMAKE_INSTALL_PREFIX})

# if this is set to ON, then all libraries are built as shared libraries by default.
MESSAGE(STATUS "BUILD_SHARED_LIBS:                    " ${BUILD_SHARED_LIBS})

# the compiler used for C files
MESSAGE(STATUS "CMAKE_C_COMPILER:                     " ${CMAKE_C_COMPILER})

# the compiler used for C++ files
MESSAGE(STATUS "CMAKE_CXX_COMPILER:                   " ${CMAKE_CXX_COMPILER})

# if the compiler is a variant of gcc, this should be set to 1
MESSAGE(STATUS "CMAKE_COMPILER_IS_GNUCC:              " ${CMAKE_COMPILER_IS_GNUCC})

# if the compiler is a variant of g++, this should be set to 1
MESSAGE(STATUS "CMAKE_COMPILER_IS_GNUCXX:             " ${CMAKE_COMPILER_IS_GNUCXX})

# the tools for creating libraries
MESSAGE(STATUS "CMAKE_AR:                             " ${CMAKE_AR})
MESSAGE(STATUS "CMAKE_RANLIB:                         " ${CMAKE_RANLIB})

IF(LIBXML2_FOUND)
     SET(ZORBA_WITH_LIBXML2_SAX ON CACHE BOOL "compile with a sax parser for libxml2")
ELSE(LIBXML2_FOUND)
     SET(ZORBA_WITH_LIBXML2_SAX ON CACHE BOOL "compile with a sax parser for libxml2")
ENDIF(LIBXML2_FOUND)

IF(WIN32)
  SET(CPACK_INSTALL_PREFIX "" CACHE STRING "Set to empty string so that cpack can work")
ENDIF(WIN32)