zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #25374
[Merge] lp:~zorba-coders/zorba/bug1064978 into lp:zorba/csv-module
Chris Hillery has proposed merging lp:~zorba-coders/zorba/bug1064978 into lp:zorba/csv-module.
Requested reviews:
Zorba Coders (zorba-coders)
Related bugs:
Bug #1064978 in Zorba: "xqxq: add new bind-variable signature"
https://bugs.launchpad.net/zorba/+bug/1064978
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug1064978/+merge/182514
--
The attached diff has been truncated due to its size.
https://code.launchpad.net/~zorba-coders/zorba/bug1064978/+merge/182514
Your team Zorba Coders is requested to review the proposed merge of lp:~zorba-coders/zorba/bug1064978 into lp:zorba/csv-module.
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2013-08-27 22:37:07 +0000
@@ -0,0 +1,2 @@
+CMakeLists.txt.user
+build
=== added file 'AUTHORS.txt'
--- AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ AUTHORS.txt 2013-08-27 22:37:07 +0000
@@ -0,0 +1,45 @@
+# 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.
+#
+
+Zorba is a joint effort between multiple authors and organizations.
+
+The primary authors are:
+
+ * Cezar Andrei
+ * Vinayak Borkar
+ * Matthias Brantner
+ * Nicolae Brinza
+ * William Candillon
+ * Dana Florescu
+ * David Graf
+ * Chris Hillery
+ * Donald Kossmann
+ * Tim Kraska
+ * Paul Kunz
+ * Carlos Lopez
+ * Paul Lucas
+ * Dan Muresan
+ * Sorin Nasoi
+ * Rodolfo Ochoa
+ * Paul Pedersen
+ * Gabriel Petrovay
+ * Markus Pilman
+ * Sam Rehman
+ * Luis Rodriguez
+ * Daniel Thomas
+ * Daniel Turcanu
+ * Till Westmann
+ * Juan Zacarias
+ * Markos Zaharioudakis
=== added file 'CMakeCPack.cmake'
--- CMakeCPack.cmake 1970-01-01 00:00:00 +0000
+++ CMakeCPack.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,129 @@
+# 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.
+#
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Zorba XQuery Processor")
+SET(CPACK_PACKAGE_VENDOR "The FLWOR Fundation")
+SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
+SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
+
+
+SET(CPACK_NSIS_COMPONENT_INSTALL ON)
+SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "FALSE")
+
+SET(CPACK_COMPONENT_UNSPECIFIED_DISPLAY_NAME "Zorba")
+SET(CPACK_COMPONENT_DOC_DISPLAY_NAME "Docs")
+SET(CPACK_COMPONENT_PHP_EXAMPLES_DISPLAY_NAME "PHP Examples")
+SET(CPACK_COMPONENT_CXX_EXAMPLES_DISPLAY_NAME "CXX Examples")
+SET(CPACK_COMPONENT_PYTHON_EXAMPLES_DISPLAY_NAME "Python Examples")
+SET(CPACK_COMPONENT_RUBY_EXAMPLES_DISPLAY_NAME "Ruby Examples")
+SET(CPACK_COMPONENT_JAVA_SWIG_DISPLAY_NAME "Java API")
+SET(CPACK_COMPONENT_PHP_SWIG_DISPLAY_NAME "PHP API")
+SET(CPACK_COMPONENT_PYTHON_SWIG_DISPLAY_NAME "Python API")
+SET(CPACK_COMPONENT_RUBY_SWIG_DISPLAY_NAME "Ruby API")
+SET(CPACK_COMPONENT_XQJ_SWIG_DISPLAY_NAME "Java XQJ API")
+SET(CPACK_COMPONENT_THESAURUS_DISPLAY_NAME "Thesaurus")
+SET(CPACK_COMPONENT_CSHARP_SWIG_DISPLAY_NAME "C# API")
+
+SET(CPACK_COMPONENT_UNSPECIFIED_DESCRIPTION "Zorba Required Files.")
+SET(CPACK_COMPONENT_DOC_DESCRIPTION "Files with the Description of different features of zorba.")
+SET(CPACK_COMPONENT_PHP_EXAMPLES_DESCRIPTION "Examples for the PHP extension.")
+SET(CPACK_COMPONENT_PYTHON_EXAMPLES_DESCRIPTION "Examples for the Python extension.")
+SET(CPACK_COMPONENT_RUBY_EXAMPLES_DESCRIPTION "Examples for the Ruby extension.")
+SET(CPACK_COMPONENT_CXX_EXAMPLES_DESCRIPTION "Examples for CXX.")
+SET(CPACK_COMPONENT_JAVA_SWIG_DESCRIPTION "API for Java")
+SET(CPACK_COMPONENT_PHP_SWIG_DESCRIPTION "API for PHP")
+SET(CPACK_COMPONENT_PYTHON_SWIG_DESCRIPTION "API for Python")
+SET(CPACK_COMPONENT_RUBY_SWIG_DESCRIPTION "API for Ruby")
+SET(CPACK_COMPONENT_XQJ_SWIG_DESCRIPTION "XQJ API for Java")
+SET(CPACK_COMPONENT_THESAURUS_DESCRIPTION "Thesaurus for Zorba")
+SET(CPACK_COMPONENT_CSHARP_SWIG_DESCRIPTION "API for C#")
+
+SET(CPACK_COMPONENT_DOC_GROUP "Documents")
+SET(CPACK_COMPONENT_PHP_EXAMPLES_GROUP "Documents")
+SET(CPACK_COMPONENT_PYTHON_EXAMPLES_GROUP "Documents")
+SET(CPACK_COMPONENT_RUBY_EXAMPLES_GROUP "Documents")
+SET(CPACK_COMPONENT_CXX_EXAMPLES_GROUP "Documents")
+
+SET(CPACK_COMPONENT_JAVA_SWIG_GROUP "APIs")
+SET(CPACK_COMPONENT_PHP_SWIG_GROUP "APIs")
+SET(CPACK_COMPONENT_PYTHON_SWIG_GROUP "APIs")
+SET(CPACK_COMPONENT_RUBY_SWIG_GROUP "APIs")
+SET(CPACK_COMPONENT_XQJ_SWIG_GROUP "APIs")
+SET(CPACK_COMPONENT_CSHARP_SWIG_GROUP "APIs")
+
+SET(CPACK_COMPONENT_GROUP_EXTERNAL_MODULES_DISPLAY_NAME "External Modules")
+SET(CPACK_COMPONENT_GROUP_EXTERNAL_MODULES_DESCRIPTION "Complete list of external modules.")
+SET(CPACK_COMPONENT_GROUP_DOCUMENTS_DESCRIPTION "Complete Documentation of Zorba and Modules.")
+SET(CPACK_COMPONENT_GROUP_APIS_DESCRIPTION "APIs to work with zorba.")
+
+SET(CPACK_ALL_INSTALL_TYPES Full Simple Lite)
+
+SET(CPACK_COMPONENT_DOC_INSTALL_TYPES Full Simple)
+SET(CPACK_COMPONENT_PHP_EXAMPLES_INSTALL_TYPES Full Simple)
+SET(CPACK_COMPONENT_PYTHON_EXAMPLES_INSTALL_TYPES Full Simple)
+SET(CPACK_COMPONENT_RUBY_EXAMPLES_INSTALL_TYPES Full Simple)
+SET(CPACK_COMPONENT_CXX_EXAMPLES_INSTALL_TYPES Full Simple)
+SET(CPACK_COMPONENT_JAVA_SWIG_INSTALL_TYPES Full)
+SET(CPACK_COMPONENT_PYTHON_SWIG_INSTALL_TYPES Full)
+SET(CPACK_COMPONENT_PHP_SWIG_INSTALL_TYPES Full)
+SET(CPACK_COMPONENT_RUBY_SWIG_INSTALL_TYPES Full)
+SET(CPACK_COMPONENT_XQJ_SWIG_INSTALL_TYPES Full)
+SET(CPACK_COMPONENT_UNSPECIFIED_INSTALL_TYPES Full Simple Lite)
+SET(CPACK_COMPONENT_THESAURUS_INSTALL_TYPES Full)
+SET(CPACK_COMPONENT_CSHARP_SWIG_INSTALL_TYPES Full)
+
+INCLUDE(${CMAKE_BINARY_DIR}/CMakeCPackModules.cmake)
+
+
+CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
+ "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
+SET(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake")
+
+SET(CPACK_PACKAGE_VERSION_MAJOR ${ZORBA_MAJOR_NUMBER})
+SET(CPACK_PACKAGE_VERSION_MINOR ${ZORBA_MINOR_NUMBER})
+SET(CPACK_PACKAGE_VERSION_PATCH ${ZORBA_PATCH_NUMBER})
+
+SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Zorba XQuery Processor ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+SET(CPACK_SOURCE_PACKAGE_FILE_NAME "zorba-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+
+IF(NOT DEFINED CPACK_SYSTEM_NAME)
+ SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
+ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
+
+IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
+IF(CMAKE_CL_64)
+ SET(CPACK_SYSTEM_NAME win64-${CMAKE_SYSTEM_PROCESSOR})
+ELSE(CMAKE_CL_64)
+ SET(CPACK_SYSTEM_NAME win32-${CMAKE_SYSTEM_PROCESSOR})
+ENDIF(CMAKE_CL_64)
+ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
+
+IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
+ SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
+ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
+SET(CPACK_PACKAGE_CONTACT "info@xxxxxxxxxxxxxx")
+
+IF(UNIX)
+ SET(CPACK_STRIP_FILES "")
+ SET(CPACK_SOURCE_STRIP_FILES "")
+ SET(CPACK_PACKAGE_EXECUTABLES "zorba" "Zorba")
+ENDIF(UNIX)
+IF ( APPLE )
+ SET(CPACK_POSTFLIGHT_SCRIPT "${CMAKE_BINARY_DIR}/osx_postflight.sh")
+ CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/scripts/osx_postflight.sh.in"
+ "${CMAKE_BINARY_DIR}/osx_postflight.sh")
+ MESSAGE ( STATUS "script = "${CPACK_POSTFLIGHT_SCRIPT} )
+ENDIF ( APPLE )
+INCLUDE(CPack)
+INCLUDE(CPack.cmake)
=== added file 'CMakeCPackOptions.cmake.in'
--- CMakeCPackOptions.cmake.in 1970-01-01 00:00:00 +0000
+++ CMakeCPackOptions.cmake.in 2013-08-27 22:37:07 +0000
@@ -0,0 +1,44 @@
+# 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.
+
+SET ( CPACK_PACKAGE_DEFAULT_LOCATION "/" )
+SET ( CPACK_PACKAGING_INSTALL_PREFIX "local" )
+SET ( CPACK_SET_DESTDIR ON )
+MESSAGE ( STATUS "current source: " ${CMAKE_SOURCE_DIR} )
+SET ( CPACK_PACKAGE_DESCRIPTION_FILE "@CMAKE_SOURCE_DIR@/README.txt")
+
+SET ( CPACK_DEBIAN_PACKAGE_DEPENDS "libxml2-dev, libicu-dev, libxerces-c-dev" )
+
+# for Windows Null Soft Installer System ...
+if(CPACK_GENERATOR MATCHES "NSIS")
+ SET(CPACK_NSIS_DISPLAY_NAME "Zorba XQuery Processor ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ SET(CPACK_NSIS_HELP_LINK "http:\\\\http://www.zorba-xquery.org/")
+ SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\http://www.zorba-xquery.org/")
+ SET(CPACK_NSIS_CONTACT "info@xxxxxxxxxxxxxx")
+
+ SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
+ CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Zorba Command Line Client.lnk' 'cmd.exe' '/K set path=%path%;%JAVA_HOME%;%JAVA_HOME%\\client;%cd%\\bin;&echo Start using Zorba: zorba -q 1+1 or zorba -f -q example.xq'
+ CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Zorba Documentation.lnk' '$INSTDIR\\\\share\\\\doc\\\\zorba-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\\\\zorba\\\\html\\\\index.html'
+ CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Modules Documentation.lnk' '$INSTDIR\\\\share\\\\doc\\\\zorba-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\\\\zorba\\\\xqdoc\\\\xhtml\\\\index.html'
+ ")
+ SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
+ !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
+ Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Zorba Command Line Client.lnk'
+ Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Zorba Documentation.lnk'
+ Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\Modules Documentation.lnk'
+ ")
+
+ SET(CPACK_NSIS_MODIFY_PATH ON)
+endif(CPACK_GENERATOR MATCHES "NSIS")
+
=== added file 'CMakeCompiler.txt'
--- CMakeCompiler.txt 1970-01-01 00:00:00 +0000
+++ CMakeCompiler.txt 2013-08-27 22:37:07 +0000
@@ -0,0 +1,264 @@
+# 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.
+
+
+# check if clang is used to compile c++
+EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
+ ARGS --version
+ OUTPUT_VARIABLE CXX_COMPILER_VERSION_OUTPUT
+)
+STRING(REGEX MATCH "clang"
+ CXX_IS_CLANG "${CXX_COMPILER_VERSION_OUTPUT}")
+IF (CXX_IS_CLANG)
+ SET (CLANG 1)
+ELSE ()
+ SET (CLANG 0)
+ENDIF ()
+
+#-----------------------------------------------------------------------------
+# Let's use the highest warning level.
+#-----------------------------------------------------------------------------
+MESSAGE(STATUS "CMAKE_BUILD_TOOL = ${CMAKE_BUILD_TOOL}")
+IF(NOT CLANG AND CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake|MSBuild)")
+ # Use only the second highest warning level for the Visual Studio
+ # compiler: /W3. This is because /W4 is too strict and generates too many
+ # warnings. This would make much of the code non-portable or too many
+ # ifdef pragma expressions would be necessary.
+ # See: http://digipen1.xmmg.com:8181/dpweb/docs/CompilingWarningLevel4.html
+
+ # for C++
+ IF(CMAKE_CXX_FLAGS MATCHES "/W[0-2]")
+ STRING(REGEX REPLACE "/W[0-2]" "/W3" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ ELSE(CMAKE_CXX_FLAGS MATCHES "/W[0-2]")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
+ ENDIF(CMAKE_CXX_FLAGS MATCHES "/W[0-2]")
+ # and for C
+ IF(CMAKE_C_FLAGS MATCHES "/W[0-2]")
+ STRING(REGEX REPLACE "/W[0-2]" "/W3" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ ELSE(CMAKE_C_FLAGS MATCHES "/W[0-2]")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
+ ENDIF(CMAKE_C_FLAGS MATCHES "/W[0-2]")
+ MESSAGE(STATUS "Increased the warning level to level 3: /W3. New flags:")
+ MESSAGE(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
+ MESSAGE(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
+
+ # For the same reasons mentioned above, disable deprecation warnings for standard C functions
+ ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_PREFIX_ -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -DUNICODE)
+
+ IF(NOT CMAKE_CXX_FLAGS MATCHES "/DNOMINMAX")
+ # avoid the min/max name clash between std versions and the
+ # ones defined in Windef.h on Windows. Disable the latter.
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DNOMINMAX")
+ MESSAGE(STATUS "Added /DNOMINMAX compiler flag to CMAKE_CXX_FLAGS. New flags:")
+ MESSAGE(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
+ ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "/DNOMINMAX")
+
+ SET(ZORBA_PROCESSORS_FOR_COMPILE $ENV{NUMBER_OF_PROCESSORS} CACHE STRING "Number of processors for compiling")
+ MESSAGE(STATUS "Number of processors/cores used for compiling ZORBA_PROCESSORS_FOR_COMPILE = ${ZORBA_PROCESSORS_FOR_COMPILE}")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${ZORBA_PROCESSORS_FOR_COMPILE}")
+ GET_FILENAME_COMPONENT(COMPILER_FULL_PATH ${CMAKE_C_COMPILER} PROGRAM)
+IF(COMPILER_FULL_PATH MATCHES "Visual Studio 8")
+ #to detect 64 bit portability issues
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wp64")
+ENDIF(COMPILER_FULL_PATH MATCHES "Visual Studio 8")
+
+ENDIF(NOT CLANG AND CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake|MSBuild)")
+
+IF(CLANG AND WIN32)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-integrated-as")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -no-integrated-as")
+ENDIF()
+
+SET(ZORBA_GNUCOMPILER_VERSION)
+SET(ZORBA_GNUCOMPILER_MAJOR_VERSION)
+IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CLANG)
+ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
+ ARGS --version
+ OUTPUT_VARIABLE ZORBA_GNUCOMPILER_VERSION
+ )
+ STRING(REGEX REPLACE ".*([0-9]\\.[0-9]\\.[0-9]).*" "\\1"
+ ZORBA_GNUCOMPILER_VERSION ${ZORBA_GNUCOMPILER_VERSION})
+ STRING(REGEX REPLACE ".*([0-9])\\.[0-9]\\.[0-9].*" "\\1"
+ ZORBA_GNUCOMPILER_MAJOR_VERSION ${ZORBA_GNUCOMPILER_VERSION})
+ MESSAGE(STATUS "Detected GNU compiler version ${ZORBA_GNUCOMPILER_VERSION} (major version ${ZORBA_GNUCOMPILER_MAJOR_VERSION})")
+ENDIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CLANG)
+
+IF(CMAKE_COMPILER_IS_GNUCXX)
+ IF (ZORBA_WITH_CODE_COVERAGE)
+ IF (NOT CMAKE_CXX_FLAGS MATCHES "profile-arcs")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs")
+ ENDIF (NOT CMAKE_CXX_FLAGS MATCHES "profile-arcs")
+ IF (NOT CMAKE_CXX_FLAGS MATCHES "test-coverage")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage")
+ ENDIF (NOT CMAKE_CXX_FLAGS MATCHES "test-coverage")
+ IF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "profile-arcs")
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs")
+ ENDIF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "profile-arcs")
+ IF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "test-coverage")
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ftest-coverage")
+ ENDIF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "test-coverage")
+ ENDIF (ZORBA_WITH_CODE_COVERAGE)
+ IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+ ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
+ IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
+ ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
+ IF(NOT CMAKE_CXX_FLAGS MATCHES "-D_FILE_OFFSET_BITS")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FILE_OFFSET_BITS=64")
+ ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-D_FILE_OFFSET_BITS")
+ IF (UNIX AND NOT APPLE)
+ IF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "as-needed")
+ SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")
+ ENDIF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "as-needed")
+ ENDIF (UNIX AND NOT APPLE)
+# # Wabi (Warn when G++ generates code that is probably not compatible with the vendor-neutral C++ ABI.)
+# IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wabi")
+# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wabi")
+# ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wabi")
+ # Warn when a class seems unusable because all the constructors or destructors in that class are private, and it has neither friends nor public static member functions.
+ IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wctor-dtor-privacy")
+ IF (NOT APPLE) # apple g++ throws to many of these warnings for boost
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wctor-dtor-privacy")
+ ENDIF (NOT APPLE)
+ ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wctor-dtor-privacy")
+# # Warn about violations of the following style guidelines from Scott Meyers� Effective C++ book (Problem: std header do not obey this guideline)
+# IF(NOT CMAKE_CXX_FLAGS MATCHES "-Weffc++")
+# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++")
+# ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Weffc++")
+# # Warn if an old-style (C-style) cast to a non-void type is used within a C++ program.
+# IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wold-style-cast")
+# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast")
+# ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wold-style-cast")
+ # Warn when a function declaration hides virtual functions from a base class.
+ IF(NOT CMAKE_CXX_FLAGS MATCHES "-Woverloaded-virtual")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual")
+ ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Woverloaded-virtual")
+ # Warn when overload resolution chooses a promotion from unsigned or enumerated type to a signed type, over a conversion to an unsigned type of the same size.
+ IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wsign-promo")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-promo")
+ ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wsign-promo")
+ # Warn about uninitialized variables which are initialized with themselves.
+ IF(NOT CMAKE_CXX_FLAGS MATCHES "-Winit-self")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Winit-self")
+ ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Winit-self")
+# # Warn if a user-supplied include directory does not exist.
+# IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wmissing-include-dirs")
+# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmissing-include-dirs")
+# ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wmissing-include-dirs")
+ # Temporarly supresses the unused parameter warning
+ IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wno-unused-parameter")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
+ ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wno-unused-parameter")
+ IF(NOT CMAKE_CXX_FLAGS MATCHES "-fPIC")
+ IF (UNIX AND NOT APPLE AND NOT CYGWIN) # not for mach libraries
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ ENDIF (UNIX AND NOT APPLE AND NOT CYGWIN)
+ ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-fPIC")
+ IF ( ZORBA_GNUCOMPILER_MAJOR_VERSION GREATER 3 )
+ IF (NOT CMAKE_CXX_FLAGS MATCHES "-fvisibility")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+ ENDIF (NOT CMAKE_CXX_FLAGS MATCHES "-fvisibility")
+ ENDIF ( ZORBA_GNUCOMPILER_MAJOR_VERSION GREATER 3 )
+ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+
+
+IF(CMAKE_COMPILER_IS_GNUCC)
+ IF (ZORBA_WITH_CODE_COVERAGE)
+ IF (NOT CMAKE_CXX_FLAGS MATCHES "profile-arcs")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs")
+ ENDIF (NOT CMAKE_CXX_FLAGS MATCHES "profile-arcs")
+ IF (NOT CMAKE_CXX_FLAGS MATCHES "test-coverage")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage")
+ ENDIF (NOT CMAKE_CXX_FLAGS MATCHES "test-coverage")
+ IF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "profile-arcs")
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs")
+ ENDIF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "profile-arcs")
+ IF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "test-coverage")
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage")
+ ENDIF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "test-coverage")
+ ENDIF (ZORBA_WITH_CODE_COVERAGE)
+ IF(NOT CMAKE_C_FLAGS MATCHES "-Wall")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
+ ENDIF(NOT CMAKE_C_FLAGS MATCHES "-Wall")
+ IF(NOT CMAKE_C_FLAGS MATCHES "-Wextra")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
+ ENDIF(NOT CMAKE_C_FLAGS MATCHES "-Wextra")
+ IF(NOT CMAKE_C_FLAGS MATCHES "-Wno-unused-parameter")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
+ ENDIF(NOT CMAKE_C_FLAGS MATCHES "-Wno-unused-parameter")
+ # Warn about uninitialized variables which are initialized with themselves.
+ IF(NOT CMAKE_C_FLAGS MATCHES "-Winit-self")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Winit-self")
+ ENDIF(NOT CMAKE_C_FLAGS MATCHES "-Winit-self")
+ # Bug 2936209 - apparently this option doesn't work in 4.0.1 . It seems it doesn't work before 4.2.4 either.
+ COMPARE_VERSION_STRINGS("${ZORBA_GNUCOMPILER_VERSION}" "4.2.4" ZORBA_GNUCOMPILER_COMPARISON)
+ IF (ZORBA_GNUCOMPILER_COMPARISON GREATER 0)
+ MESSAGE(STATUS "GNU Compiler version greater than 4.0.1")
+ IF(NOT CMAKE_C_FLAGS MATCHES "-Werror=declaration-after-statement")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=declaration-after-statement")
+ ENDIF(NOT CMAKE_C_FLAGS MATCHES "-Werror=declaration-after-statement")
+ ENDIF (ZORBA_GNUCOMPILER_COMPARISON GREATER 0)
+
+
+ #IF (ZORBA_GNUCOMPILER_VERSION STREQUAL "4.0.1")
+ # IF(NOT CMAKE_C_FLAGS MATCHES "-Werror=declaration-after-statement")
+ # SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=declaration-after-statement")
+ # ENDIF(NOT CMAKE_C_FLAGS MATCHES "-Werror=declaration-after-statement")
+ #ENDIF(ZORBA_GNUCOMPILER_VERSION STREQUAL "4.0.1")
+ IF (ZORBA_WITH_CODE_COVERAGE)
+ IF (NOT CMAKE_C_FLAGS MATCHES "profile-arcs")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs")
+ ENDIF (NOT CMAKE_C_FLAGS MATCHES "profile-arcs")
+ IF (NOT CMAKE_C_FLAGS MATCHES "test-coverage")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage")
+ ENDIF (NOT CMAKE_C_FLAGS MATCHES "test-coverage")
+ ENDIF (ZORBA_WITH_CODE_COVERAGE)
+ IF (UNIX AND NOT APPLE)
+ IF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "as-needed")
+ SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")
+ ENDIF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "as-needed")
+ ENDIF (UNIX AND NOT APPLE)
+ IF(NOT CMAKE_C_FLAGS MATCHES "-fPIC")
+ IF (UNIX AND NOT APPLE AND NOT CYGWIN) # not for mach libraries
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+ ENDIF (UNIX AND NOT APPLE AND NOT CYGWIN)
+ ENDIF(NOT CMAKE_C_FLAGS MATCHES "-fPIC")
+ IF ( ZORBA_GNUCOMPILER_MAJOR_VERSION GREATER 3 )
+ IF (NOT CMAKE_C_FLAGS MATCHES "-fvisibility")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+ ENDIF (NOT CMAKE_C_FLAGS MATCHES "-fvisibility")
+ ENDIF ( ZORBA_GNUCOMPILER_MAJOR_VERSION GREATER 3 )
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
+IF (APPLE)
+ # Needed for CFUUID*() functions in util/uuid.c.
+ SET(CMAKE_SHARED_LINKER_FLAGS "-framework CoreFoundation ${CMAKE_SHARED_LINKER_FLAGS}")
+ELSEIF (WIN32)
+ # Needed for UuidCreateSequential() function in util/uuid.c.
+ SET(requiredlibs ${requiredlibs} "Rpcrt4")
+ELSEIF (ZORBA_HAVE_UUID_H)
+ # Needed for uuid_generate() function in util/uuid.c.
+ SET(requiredlibs ${requiredlibs} "uuid")
+ # Double-check that we can link against the required library.
+ CHECK_LIBRARY_EXISTS(uuid uuid_generate "" LIBUUID_EXISTS)
+ IF (NOT LIBUUID_EXISTS)
+ MESSAGE (FATAL_ERROR "Could not find libuuid - required on Linux!")
+ ENDIF (NOT LIBUUID_EXISTS)
+ELSE (APPLE)
+ # We're not Apple or Win32, and we didn't find uuid.h - can't compile
+ MESSAGE (FATAL_ERROR "Could not find uuid/uuid.h header, which is "
+ "required on Linux. On Ubuntu, the 'uuid-dev' package is required; "
+ "look for similar packages on other platforms.")
+ENDIF (APPLE)
=== added file 'CMakeConfiguration.txt'
--- CMakeConfiguration.txt 1970-01-01 00:00:00 +0000
+++ CMakeConfiguration.txt 2013-08-27 22:37:07 +0000
@@ -0,0 +1,284 @@
+# 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 ON CACHE BOOL "enable integrated JSON support")
+MESSAGE(STATUS "ZORBA_WITH_JSON: " ${ZORBA_WITH_JSON})
+
+SET(ZORBA_WITH_THESAURUS ON CACHE BOOL
+ "enable installation of default English Wordnet thesaurus")
+MESSAGE(STATUS "ZORBA_WITH_THESAURUS: " ${ZORBA_WITH_THESAURUS})
+
+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)
=== added file 'CMakeLists.txt'
--- CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ CMakeLists.txt 2013-08-27 22:37:07 +0000
@@ -0,0 +1,624 @@
+# Copyright 2006-2010 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.
+#
+PROJECT(zorba)
+ENABLE_TESTING()
+INCLUDE(CTest)
+
+
+# overwriting the source and binary directories with the current zorba ones
+# this is usefull for other projects reusing zorba as a subcomponent
+SET(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+SET(CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake_modules/CMakeCompareVersionStrings.cmake)
+
+cmake_minimum_required(VERSION 2.6)
+IF(CMAKE_VERSION STREQUAL "2.6.3")
+ MESSAGE(FATAL_ERROR "You are running a buggy CMake version (2.6.3). Please install a different CMake version and execute CMake again.")
+ENDIF(CMAKE_VERSION STREQUAL "2.6.3")
+IF(COMMAND cmake_policy)
+ cmake_policy(SET CMP0003 NEW)
+ cmake_policy(SET CMP0002 OLD)
+ # We want CMake to correctly count empty list elements.
+ cmake_policy(SET CMP0007 NEW)
+ENDIF(COMMAND cmake_policy)
+
+IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ SET(LINUX "${CMAKE_SYSTEM}")
+ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+
+# custom ctest options
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake)
+
+# prohibit in-source-builds
+IF(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
+ MESSAGE(STATUS "In-source-builds are not allowed")
+ MESSAGE(STATUS "Clean your source directory (e.g. delete the CMakeCache.txt file)")
+ MESSAGE(FATAL_ERROR "Please create a separate build directory and call CMake again")
+ENDIF(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
+
+# set the default build type to release
+# NOTE: the "NMake Makefiles" generator will always set the default build type to "Debug"
+IF (NOT CMAKE_BUILD_TYPE)
+ SET (CMAKE_BUILD_TYPE Release CACHE STRING
+ "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+ FORCE)
+ENDIF (NOT CMAKE_BUILD_TYPE)
+
+# set the default installation directory to "dist" in the build directory
+IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ SET (CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist CACHE STRING
+ "Set the defalt installation directory to \"dist\" in the binary directory." FORCE)
+ENDIF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+
+# Enable RPaths in installed binaries
+SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
+# turn on the folder grouping used by IDEs (VS or XCode)
+SET(ZORBA_USE_TARGET_FOLDERS ON CACHE BOOL "Activate use of target grouping into folders")
+IF(ZORBA_USE_TARGET_FOLDERS)
+ SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON)
+ENDIF(ZORBA_USE_TARGET_FOLDERS)
+
+###############################################################################
+# Check for system include files, features, etc.
+###############################################################################
+INCLUDE(CheckCXXSourceCompiles)
+INCLUDE(CheckFunctionExists)
+INCLUDE(CheckIncludeFileCXX)
+INCLUDE(CheckIncludeFiles)
+INCLUDE(CheckLibraryExists)
+INCLUDE(CheckStructHasMember)
+INCLUDE(CheckSymbolExists)
+INCLUDE(CheckTypeSize)
+INCLUDE(CheckVariableExists)
+
+CHECK_INCLUDE_FILES ("unicode/coll.h" ZORBA_HAVE_COLL_H)
+CHECK_INCLUDE_FILES ("iconv.h" ZORBA_HAVE_ICONV_H)
+CHECK_INCLUDE_FILES ("inttypes.h" ZORBA_HAVE_INTTYPES_H)
+CHECK_INCLUDE_FILES ("limits.h" ZORBA_HAVE_LIMITS_H)
+CHECK_INCLUDE_FILES ("stdint.h" ZORBA_HAVE_STDINT_H)
+CHECK_INCLUDE_FILES ("stdlib.h" ZORBA_HAVE_STDLIB_H)
+CHECK_INCLUDE_FILES ("sys/param.h;sys/mount.h" ZORBA_HAVE_SYS_MOUNT_H)
+CHECK_INCLUDE_FILES ("sys/types.h" ZORBA_HAVE_SYS_TYPES_H)
+CHECK_INCLUDE_FILES ("tzfile.h" ZORBA_HAVE_TZFILE_H)
+CHECK_INCLUDE_FILES ("unicode/ustring.h" ZORBA_HAVE_USTRING_H)
+CHECK_INCLUDE_FILES ("unicode/utypes.h" ZORBA_HAVE_UTYPES_H)
+
+IF (NOT APPLE OR ${CMAKE_SYSTEM_VERSION} VERSION_GREATER "10.4")
+ # execinfo is found by this macro when cross compiling for Mac OS X 10.4
+ # although it shouldn't be found for this platform
+ CHECK_INCLUDE_FILES ("execinfo.h" ZORBA_HAVE_EXECINFO_H)
+ENDIF (NOT APPLE OR ${CMAKE_SYSTEM_VERSION} VERSION_GREATER "10.4")
+CHECK_INCLUDE_FILE_CXX ("FlexLexer.h" ZORBA_HAVE_FLEXLEXER_H)
+CHECK_INCLUDE_FILES ("uuid/uuid.h" ZORBA_HAVE_UUID_H)
+
+CHECK_FUNCTION_EXISTS (strtof ZORBA_HAVE_STRTOF_FUNCTION)
+CHECK_FUNCTION_EXISTS (strtoll ZORBA_HAVE_STRTOLL_FUNCTION)
+CHECK_FUNCTION_EXISTS (_stricmp ZORBA_HAVE_STRICMP_FUNCTION)
+CHECK_FUNCTION_EXISTS (strcat_s ZORBA_HAVE_STRCAT_S_FUNCTION)
+CHECK_FUNCTION_EXISTS (strcpy_s ZORBA_HAVE_STRCPY_S_FUNCTION)
+
+SET(CMAKE_REQUIRED_LIBRARIES pthread)
+CHECK_INCLUDE_FILES (pthread.h ZORBA_HAVE_PTHREAD_H)
+CHECK_FUNCTION_EXISTS(pthread_spin_init ZORBA_HAVE_PTHREAD_SPINLOCK)
+CHECK_FUNCTION_EXISTS(pthread_mutex_init ZORBA_HAVE_PTHREAD_MUTEX)
+SET(CMAKE_REQUIRED_LIBRARIES)
+
+CHECK_INCLUDE_FILES ("sys/time.h;sys/resource.h" ZORBA_HAVE_RUSAGE_INCLUDES)
+CHECK_FUNCTION_EXISTS (getrusage ZORBA_HAVE_RUSAGE_FUNCTION)
+
+CHECK_TYPE_SIZE("int32_t" ZORBA_HAVE_INT32_T)
+CHECK_TYPE_SIZE("uint32_t" ZORBA_HAVE_UINT32_T)
+CHECK_TYPE_SIZE("unsigned __int32" ZORBA_HAVE_MS_UINT32)
+CHECK_TYPE_SIZE("__int32" ZORBA_HAVE_MS_INT32)
+CHECK_TYPE_SIZE("int64_t" ZORBA_HAVE_INT64_T)
+
+CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff time.h ZORBA_HAVE_STRUCT_TM_TM_GMTOFF)
+CHECK_STRUCT_HAS_MEMBER("struct tm" __tm_gmtoff time.h ZORBA_HAVE_STRUCT_TM___TM_GMTOFF)
+
+# C++ built-in type sizes
+CHECK_TYPE_SIZE("double" ZORBA_SIZEOF_DOUBLE BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("float" ZORBA_SIZEOF_FLOAT BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("int" ZORBA_SIZEOF_INT BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("long" ZORBA_SIZEOF_LONG BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("long long" ZORBA_SIZEOF_LONG_LONG BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("void*" ZORBA_SIZEOF_POINTER BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("short" ZORBA_SIZEOF_SHORT BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("size_t" ZORBA_SIZEOF_SIZE_T)
+SET(CMAKE_EXTRA_INCLUDE_FILES wchar.h)
+CHECK_TYPE_SIZE("wchar_t" ZORBA_SIZEOF_WCHAR_T)
+SET(CMAKE_EXTRA_INCLUDE_FILES)
+
+# C++11 langauge features
+CHECK_CXX_SOURCE_COMPILES(
+ "int main() { int *p = nullptr; }" ZORBA_CXX_NULLPTR)
+CHECK_CXX_SOURCE_COMPILES(
+ "int main() { static_assert(1,\"\"); }" ZORBA_CXX_STATIC_ASSERT)
+
+# C++11 standard library types
+CHECK_CXX_SOURCE_COMPILES (
+ "#include <type_traits>
+ int main() { std::enable_if<true,int> x; }" ZORBA_HAVE_ENABLE_IF)
+CHECK_CXX_SOURCE_COMPILES ("
+ #include <memory>
+ int main() { std::unique_ptr<int> p; }" ZORBA_HAVE_UNIQUE_PTR)
+CHECK_CXX_SOURCE_COMPILES (
+ "#include <unordered_map>
+ int main() { std::unordered_map<int,int> m; }" ZORBA_HAVE_UNORDERED_MAP)
+CHECK_CXX_SOURCE_COMPILES (
+ "#include <unordered_set>
+ int main() { std::unordered_set<int> s; }" ZORBA_HAVE_UNORDERED_SET)
+
+################################################################################
+# Various cmake macros
+
+SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules ${CMAKE_MODULE_PATH})
+IF (WIN32)
+ # On Windows we use proxy modules that try to guess first the location
+ # of the required third party libraries. This will search in order in:
+ # 1. the path pointed by ZORBA_THIRD_PARTY_REQUIREMENTS
+ # 2. the Program Files directory available on the users computer
+ # 3. the PATH environment variable
+ # The logic is implemented by the macros in the ProxyFindModule.cmake module.
+ SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/Windows ${CMAKE_MODULE_PATH})
+ INCLUDE (ProxyFindModule)
+ENDIF (WIN32)
+
+################################################################################
+# This section is used for batch script and Visual Studio Project file generation.
+# Each executable on Windows needs a bat script and in the Visual Studio build a \
+# pre-generated Visual Studio Project file in order to set the PATH to the required DLLs.
+# For this we use CACHE variables to gather all the information generated
+# throughout the cmake execution (required DLLs, list of scripts to generate).
+# The generation occurs only at the end of CMake execution (through the macro
+# ZORBA_GENERATE_EXE_HELPERS_WIN32) when ALL the requirements have been found.
+# E.g. zorba.exe needs in PATH all the DLLs of all external modules, etc.
+IF (WIN32)
+ # Clear all the variables because they are used only for this build.
+ SET (ZORBA_REQUIRED_DLLS ""
+ CACHE STRING "List of DLLs that must be installed" FORCE
+ )
+ SET (ZORBA_REQUIRED_DLL_PATHS ""
+ CACHE STRING "List of paths executable require in order to find the required DLLs" FORCE
+ )
+ SET (ZORBA_EXE_SCRIPT_LIST ""
+ CACHE STRING "List of Windows batch scripts to be generated, one for each executable" FORCE
+ )
+ IF (MSVC_IDE)
+ SET (ZORBA_VC_PROJECT_FILE_LIST ""
+ CACHE STRING "List of Visual Studio project files to be generated, one for each executable" FORCE
+ )
+ ENDIF(MSVC_IDE)
+
+ # Moreover, mark it as advanced since the CMake GUI user should not see this.
+ MARK_AS_ADVANCED (FORCE ZORBA_REQUIRED_DLLS)
+ MARK_AS_ADVANCED (FORCE ZORBA_REQUIRED_DLL_PATHS)
+ MARK_AS_ADVANCED (FORCE ZORBA_EXE_SCRIPT_LIST)
+ IF (MSVC_IDE)
+ MARK_AS_ADVANCED (FORCE ZORBA_VC_PROJECT_FILE_LIST)
+ ENDIF(MSVC_IDE)
+ENDIF (WIN32)
+################################################################################
+
+
+# ZorbaModule includes a number of generally-useful utility functions,
+# including expected_failure(). Include it now (very early) to ensure
+# the "expected_failure()" function is available to anyone who might
+# add tests.
+INCLUDE(ZorbaModule)
+
+################################################################################
+# #
+# Search for all the external libraries that any library or executable under #
+# this CMake depends on. #
+# #
+################################################################################
+
+FOREACH(path "${CMAKE_PREFIX_PATH}")
+ IF(EXISTS "${path}")
+ MESSAGE("path entry: ${path}")
+ ELSE(EXISTS "${path}")
+ # Ignore non-existing paths
+ #MESSAGE("Non-existing path!: ${path}")
+ ENDIF(EXISTS "${path}")
+ENDFOREACH(path)
+
+SET(requiredlibs)
+SET(requiredlibs-store)
+
+# Check for POSIX high-resolution timers - might be in "rt" library
+CHECK_LIBRARY_EXISTS(rt clock_gettime "" _clock_gettime_in_rt)
+IF(_clock_gettime_in_rt)
+ SET(requiredlibs ${requiredlibs} rt)
+ SET(ZORBA_HAVE_CLOCKGETTIME_FUNCTION YES CACHE BOOL "Platform has clock_gettime (in librt)")
+ELSE(_clock_gettime_in_rt)
+ CHECK_FUNCTION_EXISTS(clock_gettime ZORBA_HAVE_CLOCKGETTIME_FUNCTION)
+ENDIF(_clock_gettime_in_rt)
+
+#
+# TcMalloc support
+#
+IF(ZORBA_USE_TCMALLOC)
+ MESSAGE (STATUS "Looking for TcMalloc")
+
+ FIND_PACKAGE(TcMalloc)
+ IF(Tcmalloc_FOUND)
+ SET(requiredlibs ${requiredlibs} ${Tcmalloc_LIBRARIES})
+ ELSE(Tcmalloc_FOUND)
+ MESSAGE(FATAL_ERROR "TcMalloc not found")
+ ENDIF(Tcmalloc_FOUND)
+ENDIF(ZORBA_USE_TCMALLOC)
+
+#
+# GooglePerfTools support
+#
+IF(ZORBA_WITH_CPU_PROFILE)
+ MESSAGE(STATUS "Looking for GooglePerfTools")
+
+ FIND_PACKAGE(GooglePerfTools)
+ IF(GooglePerfTools_FOUND)
+ SET(requiredlibs ${requiredlibs} ${GooglePerfTools_LIBRARIES})
+ ELSE(GooglePerfTools_FOUND)
+ MESSAGE(FATAL_ERROR "GooglePerfTools not found. Cannot build with CPU profiling")
+ ENDIF(GooglePerfTools_FOUND)
+ENDIF(ZORBA_WITH_CPU_PROFILE)
+
+#
+# LibXml2
+#
+MESSAGE(STATUS "Looking for LibXml2")
+FIND_PACKAGE(LibXml2)
+IF(LIBXML2_FOUND)
+ # Now check LibXml2's version
+ FILE(STRINGS ${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h LIBXML2_VERSION_TMP REGEX
+ "^#define[ \t]+LIBXML_DOTTED_VERSION[ \t]+\".*\"")
+ STRING(REGEX REPLACE "^#define[ \t]+LIBXML_DOTTED_VERSION[ \t]+\"(.*)\"" "\\1"
+ LIBXML2_VERSION ${LIBXML2_VERSION_TMP})
+
+ IF(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
+ MESSAGE(STATUS "Found LIBXML2 library -- " ${LIBXML2_LIBRARIES})
+ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
+ SET(requiredlibs-store ${requiredlibs-store} ${LIBXML2_LIBRARIES})
+ SET(CXXFLAGS ${CXXFLAGS} ${LIBXML2_DEFINITONS})
+ ELSE(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
+ MESSAGE(FATAL_ERROR "The libxml2 library version 2.7.0 or higher is required in order to build Zorba.")
+ ENDIF(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
+
+ELSE(LIBXML2_FOUND)
+ MESSAGE(FATAL_ERROR "The libxml2 library and headers are required in order to build simple store.")
+ENDIF(LIBXML2_FOUND)
+MESSAGE(STATUS "")
+
+#
+# Pthreads
+#
+IF(ZORBA_HAVE_PTHREAD_H AND NOT ZORBA_FOR_ONE_THREAD_ONLY)
+ SET(requiredlibs ${requiredlibs} pthread)
+ENDIF(ZORBA_HAVE_PTHREAD_H AND NOT ZORBA_FOR_ONE_THREAD_ONLY)
+
+#
+# Iconv
+#
+IF(WIN32)
+ MESSAGE(STATUS "Looking for Iconv")
+ FIND_PACKAGE(Iconv REQUIRED)
+
+ IF(ICONV_FOUND)
+ MESSAGE(STATUS "Found Iconv library -- " ${ICONV_LIBRARY})
+ INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
+ SET(requiredlibs ${requiredlibs} ${ICONV_LIBRARY})
+ ELSE(ICONV_FOUND)
+ MESSAGE(STATUS "The Iconv library was not found.")
+ ENDIF(ICONV_FOUND)
+ MESSAGE(STATUS "")
+ENDIF(WIN32)
+
+#
+# ICU
+#
+MESSAGE(STATUS "Looking for ICU")
+FIND_PACKAGE(ICU)
+
+IF(ICU_FOUND AND ICU_I18N_FOUND AND ICU_DATA_FOUND)
+ MESSAGE(STATUS "Found ICU library -- " ${ICU_LIBRARIES})
+
+ INCLUDE_DIRECTORIES(${ICU_INCLUDE_DIRS})
+ SET(requiredlibs ${requiredlibs} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES} ${ICU_DATA_LIBRARIES})
+ELSE(ICU_FOUND AND ICU_I18N_FOUND AND ICU_DATA_FOUND)
+ MESSAGE(FATAL_ERROR "The ICU library is required in order to build Zorba.")
+ENDIF(ICU_FOUND AND ICU_I18N_FOUND AND ICU_DATA_FOUND)
+MESSAGE(STATUS "")
+
+#
+# Xerces-C part 1 - finding in default locations
+#
+MESSAGE (STATUS "Looking for Xerces-C")
+FIND_PACKAGE (XercesC)
+MESSAGE (STATUS "")
+
+#
+# shlwapi
+#
+IF(WIN32)
+ SET(requiredlibs ${requiredlibs} "shlwapi")
+ENDIF(WIN32)
+
+#
+# SWIG
+#
+IF (NOT ZORBA_SUPPRESS_SWIG)
+ FIND_PACKAGE (SWIG)
+
+ COMPARE_VERSION_STRINGS("${SWIG_VERSION}" "1.3.40" result)
+ IF(result LESS 0)
+ MESSAGE(WARNING "You need at least SWIG version 1.3.40")
+ ENDIF(result LESS 0)
+
+
+ IF (SWIG_FOUND)
+ # this will be used both in swig and doc sub-directories
+
+ #
+ # PHP5
+ #
+ FIND_PACKAGE (PHP5)
+
+ #
+ # Python
+ #
+ FIND_PACKAGE (PythonInterp)
+ FIND_PACKAGE (PythonLibs)
+
+ ELSE (SWIG_FOUND)
+ MESSAGE (STATUS "SWIG not found => no language bindings are generated.")
+ ENDIF (SWIG_FOUND)
+ELSE (NOT ZORBA_SUPPRESS_SWIG)
+ MESSAGE (STATUS "SWIG is disabled => no language bindings are generated.")
+ENDIF (NOT ZORBA_SUPPRESS_SWIG)
+
+
+LIST(APPEND requiredlibs ${requiredlibs-store})
+
+################################################################################
+# Setup Compiler Options
+# Note that this needs to be done after all packages are found because
+# it sets variables based on whether packages have been found or not.
+INCLUDE(CMakeConfiguration.txt)
+INCLUDE(CMakeCompiler.txt)
+
+#
+# LibXslt
+#
+IF(ZORBA_XQUERYX)
+ MESSAGE(STATUS "Looking for LibXslt")
+ FIND_PACKAGE(LibXslt)
+ IF(LIBXSLT_FOUND)
+ MESSAGE(STATUS "Found LIBXSLT library -- " ${LIBXSLT_LIBRARIES})
+
+ INCLUDE_DIRECTORIES(${LIBXSLT_INCLUDE_DIR})
+ SET(requiredlibs ${requiredlibs} ${LIBXSLT_LIBRARIES})
+ SET(CXXFLAGS ${CXXFLAGS} ${LIBXSLT_DEFINITONS})
+ ELSE(LIBXSLT_FOUND)
+ MESSAGE(FATAL_ERROR "The libxslt library is required in order to build zorba with xqueryx capabilities.")
+ ENDIF(LIBXSLT_FOUND)
+ MESSAGE(STATUS "")
+ENDIF(ZORBA_XQUERYX)
+
+
+#
+# Xerces-C part 2 - version verification
+#
+IF (NOT ZORBA_NO_XMLSCHEMA)
+ # Find XercesC Version based on ${XERCESC_INCLUDE}
+ FIND_PACKAGE(XercesCVersion)
+
+ IF (XERCESC_FOUND)
+ COMPARE_VERSION_STRINGS("${XERCESC_VERSION}" 2.8.0 result)
+
+ IF (result LESS 0)
+ MESSAGE(FATAL_ERROR "Xerces-C ${XERCESC_VERSION} not supported.
+ Only 2.8.0, 3.0.1 and newer versions are supported
+ or
+ Use -D ZORBA_NO_XMLSCHEMA=ON option for building without XMLSchema support.")
+ ELSE (result LESS 0)
+ MESSAGE(STATUS "Found Xerces ${XERCESC_VERSION} -- " ${XERCESC_INCLUDE} ${XERCESC_LIBRARY})
+ INCLUDE_DIRECTORIES(${XERCESC_INCLUDE})
+ SET(requiredlibs ${requiredlibs} ${XERCESC_LIBRARY})
+ ENDIF (result LESS 0)
+ ELSE (XERCESC_FOUND)
+ MESSAGE(FATAL_ERROR "Xerces-C not found.
+ Make sure you have Xerces-C 2.8.0 or 3.0.1+ installed
+ or
+ Use -D ZORBA_NO_XMLSCHEMA=ON option for building without XMLSchema support.")
+ ENDIF (XERCESC_FOUND)
+ELSE (NOT ZORBA_NO_XMLSCHEMA)
+ MESSAGE(STATUS "ZORBA_NO_XMLSCHEMA: ${ZORBA_NO_XMLSCHEMA}"
+ " - build without XMLSchema support")
+ENDIF (NOT ZORBA_NO_XMLSCHEMA)
+
+IF(WIN32)
+ SET(requiredlibs ${requiredlibs} wsock32)
+
+ # Clear those variables because this is used only for this build.
+ # A cache variable is needed since this must be modified by subdirectories
+ # and be visible at this level when ZORBA_GENERATE_EXE_HELPERS_WIN32 is called
+ SET(ZORBA_EXE_SCRIPT_LIST "" CACHE STRING "List of bat scripts" FORCE)
+ SET(ZORBA_VC_PROJECT_FILE_LIST "" CACHE STRING "List of VC project files" FORCE)
+ENDIF(WIN32)
+
+################################################################################
+# Variables
+SET(DEFINITIONS)
+
+################################################################################
+# Custom user-defined settings
+INCLUDE ("CMakeUser.txt" OPTIONAL)
+
+
+################################################################################
+# Compiler setup
+
+# add the include dir (i.e. the library) to the include path
+INCLUDE_DIRECTORIES(AFTER ${CMAKE_CURRENT_BINARY_DIR}/include)
+INCLUDE_DIRECTORIES(AFTER ${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+# zorba versioning
+SET(ZORBA_MAJOR_NUMBER "2")
+SET(ZORBA_MINOR_NUMBER "8")
+SET(ZORBA_PATCH_NUMBER "0")
+SET(ZORBA_VERSION ${ZORBA_MAJOR_NUMBER}.${ZORBA_MINOR_NUMBER}.${ZORBA_PATCH_NUMBER})
+MESSAGE(STATUS "Zorba version number: ${ZORBA_VERSION}")
+
+SET(ZORBA_LIB_DIRNAME "lib" CACHE STRING
+ "directory name for libs (may want to set to 'lib64' on 64-bit Linux platforms)")
+
+# Directories for modules and schemas. "Core" are those which are
+# shipped with Zorba and must be present for correct Zorba
+# functionality. "Non-core" are developed independently of Zorba and
+# have different version lifecycles.
+#
+# URI dir is for things resolved by URI - specifically modules (.xq
+# files) and schemas (.xsd files) - which are platform-
+# independent. Lib dir is for platform-specific files, specifically
+# shared libraries for module external functions.
+SET(ZORBA_NONCORE_URI_DIR "share/zorba/uris"
+ CACHE STRING "Path (relative to installdir) to non-core modules/schemas")
+MARK_AS_ADVANCED(ZORBA_NONCORE_URI_DIR)
+SET(ZORBA_CORE_URI_DIR "${ZORBA_NONCORE_URI_DIR}/core/${ZORBA_VERSION}"
+ CACHE STRING "Path (relative to installdir) to core modules/schemas")
+MARK_AS_ADVANCED(ZORBA_CORE_URI_DIR)
+SET(ZORBA_NONCORE_LIB_DIR "${ZORBA_LIB_DIRNAME}/zorba"
+ CACHE STRING "Path (relative to installdir) to non-core libraries")
+MARK_AS_ADVANCED(ZORBA_NONCORE_LIB_DIR)
+SET(ZORBA_CORE_LIB_DIR "${ZORBA_NONCORE_LIB_DIR}/core/${ZORBA_VERSION}"
+ CACHE STRING "Path (relative to installdir) to core libraries")
+MARK_AS_ADVANCED(ZORBA_CORE_LIB_DIR)
+
+# add compiler variables
+ADD_DEFINITIONS(${DEFINITIONS})
+
+
+################################################################################
+# find all dylib files (i.e. transitive closure of the library files
+# that are linked)
+IF(APPLE)
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_SOURCE_DIR}/scripts/find_macosx_libraries.sh ${ICU_LIBRARIES}
+ OUTPUT_VARIABLE Zorba_ICUUC)
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_SOURCE_DIR}/scripts/find_macosx_libraries.sh ${ICU_I18N_LIBRARIES}
+ OUTPUT_VARIABLE Zorba_ICUI18N)
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_SOURCE_DIR}/scripts/find_macosx_libraries.sh ${ICU_DATA_LIBRARIES}
+ OUTPUT_VARIABLE Zorba_ICU_DATA)
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_SOURCE_DIR}/scripts/find_macosx_libraries.sh ${XERCESC_LIBRARY}
+ OUTPUT_VARIABLE Zorba_XERCESC)
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_SOURCE_DIR}/scripts/find_macosx_libraries.sh ${LIBXML2_LIBRARIES}
+ OUTPUT_VARIABLE Zorba_XML2)
+ENDIF(APPLE)
+
+
+SET (ZORBA_MODULES_DIR "${CMAKE_SOURCE_DIR}/../zorba_modules"
+ CACHE PATH "Path to directory (outside of Zorba svn root) containing external modules to add to the build")
+
+# Subdir of the installation directory for CMake files, relative to
+# CMAKE_INSTALL_PREFIX.
+IF (WIN32)
+ SET(ZORBA_CMAKE_DIR "cmake" CACHE STRING
+ "Relative path to CMake files in Zorba installation")
+ELSE (WIN32)
+ SET(ZORBA_CMAKE_DIR "share/cmake/zorba-${ZORBA_VERSION}" CACHE STRING
+ "Relative path to CMake files in Zorba installation")
+ENDIF (WIN32)
+
+################################################################################
+# #
+# Tell CMake to process the sub-directories #
+# #
+################################################################################
+
+ADD_SUBDIRECTORY(scripts)
+ADD_SUBDIRECTORY(cmake_modules)
+
+# Subdirectory ordering: We need to include "bin" before "test" so
+# that test/fots can add zorbacmd-based tests. We need to include
+# "test" before "config" so ZorbaConfig knows about testdriver. We
+# need to include "config" before "modules" so external modules will
+# be able to find ZorbaConfig.cmake. We need to include "modules"
+# before "include" so config.h can know eg. whether we found CURL. We
+# need to include "modules" before "doc" so xqdoc can know what
+# non-core modules are available.
+
+ADD_SUBDIRECTORY(bin)
+
+ADD_SUBDIRECTORY(test)
+ADD_SUBDIRECTORY(config)
+ADD_SUBDIRECTORY(schemas)
+ADD_SUBDIRECTORY(modules)
+ADD_SUBDIRECTORY(doc)
+ADD_SUBDIRECTORY(include)
+
+ADD_DEFINITIONS(-Dzorba_EXPORTS)
+ADD_SUBDIRECTORY(src)
+REMOVE_DEFINITIONS(-Dzorba_EXPORTS)
+
+IF (SWIG_FOUND)
+ ADD_SUBDIRECTORY (swig)
+ENDIF (SWIG_FOUND)
+
+# add the uninstall support
+# QQQ move to config/
+CONFIGURE_FILE(
+ "${CMAKE_CURRENT_SOURCE_DIR}/CMakeUninstall.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/CMakeUninstall.cmake"
+ @ONLY)
+ADD_CUSTOM_TARGET(uninstall
+ "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeUninstall.cmake")
+
+SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+INCLUDE(InstallRequiredSystemLibraries)
+
+IF (NOT ZORBA_SKIP_CPACK)
+ # QQQ move to config/ ?
+ INCLUDE(CMakeCPack.cmake)
+ENDIF (NOT ZORBA_SKIP_CPACK)
+
+IF (APPLE AND UNIVERSAL)
+ SET (CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "archs" FORCE)
+ SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -v" )
+ # The following is not the default when building universal
+ INCLUDE_DIRECTORIES (SYSTEM /usr/local/include)
+ SET (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -v")
+ MESSAGE ("Building Apple universal binaries")
+ENDIF (APPLE AND UNIVERSAL)
+
+IF (WIN32)
+ ZORBA_GENERATE_EXE_HELPERS_WIN32 ()
+ENDIF (WIN32)
+
+# This must be done last! Create the one top-level target which
+# depends on all generated (copied) module/schema files.
+DONE_DECLARING_ZORBA_URIS()
+
+# This dependency makes sure that the error and warning definition
+# modules are generated before trying to install them as zorba modules.
+# This dependency is zorba-only related, which is why it's added here
+# and not within zorba-modules, which is for general use in other
+# non-zorba modules.
+ADD_DEPENDENCIES(check_core_uris gen_diag_modules)
=== renamed file 'CMakeLists.txt' => 'CMakeLists.txt.moved'
=== added file 'CMakeUninstall.cmake.in'
--- CMakeUninstall.cmake.in 1970-01-01 00:00:00 +0000
+++ CMakeUninstall.cmake.in 2013-08-27 22:37:07 +0000
@@ -0,0 +1,36 @@
+# 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.
+#
+IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+ MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+
+FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+STRING(REGEX REPLACE "\n" ";" files "${files}")
+FOREACH(file ${files})
+ MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+ IF(EXISTS "$ENV{DESTDIR}${file}")
+ EXEC_PROGRAM(
+ "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+ OUTPUT_VARIABLE rm_out
+ RETURN_VALUE rm_retval
+ )
+ IF("${rm_retval}" STREQUAL 0)
+ ELSE("${rm_retval}" STREQUAL 0)
+ MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+ ENDIF("${rm_retval}" STREQUAL 0)
+ ELSE(EXISTS "$ENV{DESTDIR}${file}")
+ MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+ ENDIF(EXISTS "$ENV{DESTDIR}${file}")
+ENDFOREACH(file)
=== added file 'CPack.cmake'
--- CPack.cmake 1970-01-01 00:00:00 +0000
+++ CPack.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,26 @@
+# 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.
+#
+
+IF (WIN32 AND NOT UNIX)
+ INCLUDE(WIN32.cpack)
+ENDIF (WIN32 AND NOT UNIX)
+
+IF (APPLE)
+
+ENDIF (APPLE)
+
+IF (UNIX AND NOT APPLE)
+
+ENDIF (UNIX AND NOT APPLE)
=== added file 'CPackSourceConfig.cmake.in'
--- CPackSourceConfig.cmake.in 1970-01-01 00:00:00 +0000
+++ CPackSourceConfig.cmake.in 2013-08-27 22:37:07 +0000
@@ -0,0 +1,54 @@
+# 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.
+
+
+SET(CPACK_PACKAGE_VERSION_MAJOR @ZORBA_MAJOR_NUMBER@)
+SET(CPACK_PACKAGE_VERSION_MINOR @ZORBA_MINOR_NUMBER@)
+SET(CPACK_PACKAGE_VERSION_PATCH @ZORBA_PATCH_NUMBER@)
+
+SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
+SET(CPACK_GENERATOR "TGZ;TZ")
+SET(CPACK_IGNORE_FILES "test/coverity/;dist/;_CPack_Packages/;build/;build./;CVS/;/\\.svn/;\\.swp$;\\.#;/#;\\.bzr/")
+SET(CPACK_INSTALLED_DIRECTORIES "@CMAKE_SOURCE_DIR@;/")
+SET(CPACK_INSTALL_CMAKE_PROJECTS "")
+SET(CPACK_MODULE_PATH "")
+SET(CPACK_NSIS_DISPLAY_NAME "Zorba @CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@")
+SET(CPACK_OUTPUT_CONFIG_FILE "@CMAKE_BINARY_DIR@/CPackConfig.cmake")
+SET(CPACK_PACKAGE_CONTACT "info@xxxxxxxxxxxxxx")
+SET(CPACK_PACKAGE_DESCRIPTION_FILE "@CMAKE_SOURCE_DIR@/README.txt")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Zorba - The XQuery Processor")
+SET(CPACK_PACKAGE_EXECUTABLES "zorba;Zorba")
+SET(CPACK_PACKAGE_NAME "Zorba")
+SET(CPACK_PACKAGE_VENDOR "The FLWOR Foundation")
+SET(CPACK_PACKAGE_VERSION "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@")
+SET(CPACK_PACKAGE_FILE_NAME "zorba-${CPACK_PACKAGE_VERSION}")
+SET(CPACK_PACKAGE_VERSION_MAJOR "@CPACK_PACKAGE_VERSION_MAJOR@")
+SET(CPACK_PACKAGE_VERSION_MINOR "@CPACK_PACKAGE_VERSION_MINOR@")
+SET(CPACK_PACKAGE_VERSION_PATCH "@CPACK_PACKAGE_VERSION_PATCH@")
+SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Zorba @CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR")
+SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Zorba ${CPACK_PACKAGE_VERSION}")
+SET(CPACK_PROJECT_CONFIG_FILE "@CMAKE_BINARY_DIR@/CMakeCPackOptions.cmake")
+SET(CPACK_RESOURCE_FILE_LICENSE "@CMAKE_SOURCE_DIR@/LICENSE.txt")
+#SET(CPACK_RESOURCE_FILE_README "/opt/local/share/cmake-2.4/Templates/CPack.GenericDescription.txt")
+#SET(CPACK_RESOURCE_FILE_WELCOME "/opt/local/share/cmake-2.4/Templates/CPack.GenericWelcome.txt")
+SET(CPACK_SOURCE_GENERATOR "TGZ;TZ")
+SET(CPACK_SOURCE_IGNORE_FILES "dist/;build*/;/CVS/;/\\.svn/;\\.swp$;\\.#;/#")
+SET(CPACK_SOURCE_INSTALLED_DIRECTORIES "@CMAKE_SOURCE_DIR@;/")
+SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "@CMAKE_BINARY_DIR@/CPackSourceConfig.cmake")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "zorba-src_@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@")
+SET(CPACK_SOURCE_STRIP_FILES "")
+#SET(CPACK_SOURCE_TOPLEVEL_TAG "Darwin-i386-Source")
+SET(CPACK_STRIP_FILES "")
+#SET(CPACK_SYSTEM_NAME "Darwin-i386")
+#SET(CPACK_TOPLEVEL_TAG "Darwin-i386-Source")
=== added file 'CTestConfig.cmake'
--- CTestConfig.cmake 1970-01-01 00:00:00 +0000
+++ CTestConfig.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,26 @@
+# 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.
+SET (CTEST_DROP_METHOD http)
+SET (CTEST_PROJECT_NAME "Zorba")
+SET (CTEST_NIGHTLY_START_TIME "00:00:00 GMT")
+SET (CTEST_DROP_SITE "zorbatest.lambda.nu:8080")
+SET (CTEST_DROP_LOCATION "/cdash/submit.php?project=Zorba")
+SET (CTEST_DROP_SITE_CDASH TRUE)
+SET (CTEST_CUSTOM_WARNING_EXCEPTION
+ ${CTEST_CUSTOM_WARNING_EXCEPTION}
+ "Warning: GNU Bison.*"
+ "Warning: using repository file.*"
+ "Warning: urning: GNU Flex.*")
+SET (CTEST_COMPRESS_SUBMISSION ON)
+SET (VALGRIND_COMMAND_OPTIONS "--tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --track-origins=yes")
=== added file 'CTestCustom.cmake'
--- CTestCustom.cmake 1970-01-01 00:00:00 +0000
+++ CTestCustom.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,35 @@
+# 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.
+
+# do not take mapm into the coverage analysis
+SET (CTEST_CUSTOM_COVERAGE_EXCLUDE "mapm.*")
+SET (CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 8192)
+SET (CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 8192)
+
+# other possible options
+# CTEST_CUSTOM_ERROR_MATCH Regular expression for errors during build process
+# CTEST_CUSTOM_ERROR_EXCEPTION Regular expression for error exceptions during build process
+# CTEST_CUSTOM_WARNING_MATCH Regular expression for warnings during build process
+# CTEST_CUSTOM_WARNING_EXCEPTION Regular expression for warning exception during build process
+# CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS Maximum number of errors to display
+# CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS Maximum number of warnings to display
+# CTEST_CUSTOM_TESTS_IGNORE List of tests to ignore during the Test stage
+# CTEST_CUSTOM_MEMCHECK_IGNORE List of tests to ignore during the MemCheck stage
+# CTEST_CUSTOM_PRE_TEST Command to execute before any tests are run during Test stage
+# CTEST_CUSTOM_POST_TEST Command to execute after any tests are run during Test stage
+# CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE Maximum size of passed test output
+# CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE Maximum size of failed test output
+# CTEST_CUSTOM_PRE_MEMCHECK Command to execute before any tests are run during MemCheck stage
+# CTEST_CUSTOM_POST_MEMCHECK Command to execute after any tests are run during MemCheck stage
+# CTEST_CUSTOM_COVERAGE_EXCLUDE
=== added file 'ChangeLog'
--- ChangeLog 1970-01-01 00:00:00 +0000
+++ ChangeLog 2013-08-27 22:37:07 +0000
@@ -0,0 +1,811 @@
+Zorba - The XQuery Processor
+
+version 2.9
+
+New Features:
+ * Typeswitch expression extended to allow union of types in each case clause,
+ as specified by XQuery v3.0
+ * In C++ API, added optional XML formatting of exceptions.
+ * Bind zerr:line-number-end and zerr:column-number-end variables in the body
+ of a catch clause.
+ * New C++ and XQuery function (see module http://www.zorba-xquery.com/modules/item)
+ to estimate the size an item allocates in memory.
+ * Extended sequence types to include unions, as specified by XQuery v3.0
+ * Added XQuery::parse(std::istream& aQuery, ModuleInfo_t& aResult) function.
+ * In store API, added ability to specify a stream's originating URI (file)
+ for streamable strings and base64Binary.
+ * Added millis-to-dateTime() function in datetime module.
+ * Added setCalendar(), getCalendar(), setLocale(), and getLocale() to
+ DynamicContext class in C++ API.
+ * fn:trace outputs "empty-sequence()" if the input is the empty-sequence.
+ * Allow multiple default function namespaces.
+ * Implemented computed namespace constructors and namespace-node() kindTest.
+ * $array() => jn:members($array), $object() => jn:keys($object)
+ * Added xqxq:variable-value function.
+ * Added canonicalize function to modules/xml.
+ * Added support for xs:dateTimeStamp type from XMLSchema 1.1, bug #924754.
+
+Optimizations:
+ * Extended optimization rules for subsequence function (pushing $startingLoc
+ parameter into collection skip if $sourceSeq parameter is from a
+ collection).
+ * Introduced generic framework for optimizing fn:count() during runtime:
+ Virtual PlanIterator::count() method provides the base (unoptimized)
+ implementation of fn:count(). This base method is redefined by other plan
+ iterators who have a way of returning the cardinality of their result
+ sequence without actually computing the full result sequence.
+ * Optimized fn:index-of function
+ * Extented index join rule to general flwor expressions.
+
+Bug Fixes/Other Changes:
+ * Fixed bug #1123836 (overflows in date/time casts now return FODT0001 and
+ in durations return FODT0002)
+ * Fixed bug #1114228 (unrecognized options in the XQuery namespace now raise an error)
+ * Fixed bug #1124273 (xqdoc crash because of annotation literals)
+ * Fixed bug #867027 (XQST0059 error messages inconsistent)
+ * Fixed bug #1095889 (Improve error message for xml-parsing error).
+ * Fixed bug #1123163 (fn:format-integer failures)
+ * Fixed bug in index join rule (no index join if inner clause has positional var).
+ * Fixed bug in index join rule (copy var ids after cloning index domain expr).
+ * Fixed bug #1123162 (FOTS: formatting dates and times failures)
+ * Added missing wrapper expressions around some variable references.
+ * Fixed optimizer bug: elimination of positional variable sometimes caused
+ elimination of whole FOR clause.
+ * Fixed bug in the throwing of error XQTY0086 during node construction.
+ * Fixed bug #1148335 (where-clause expression was not always reset when it should be)
+ * Fixed bug #1122396 (Associate origin/destination URI to I/O stream)
+ * Fixed bug #1111786 (xml/json parse error location in catch clause).
+ * Fixed bug #1153800 (construct hexBinary without encoding the data)
+ * Fixed bug #1076402 (bug in CastIterator when target is QName)
+ * NaN items are considered equal to each other during grouping
+ * Fixed bug #855481 (Too small time types on Windows).
+ * Fixed bug #1154984 (windows build crashes if a vector iterator is reused
+ after it is used to erase an element of the vector)
+ * Fixed bug #1132032 (Certain regexes involving ^ should be legal)
+ * Fixed bug #1023168 (Non-single-char-escapes in regex character ranges not
+ caught)
+ * Throw XQST0048 for groupby clause, as specified by XQuery 3.0.
+ * Fixed bug #866874 (regex "range subtraction" not supported for ICU)
+ * Fixed bug in computing the static type of an allowing-empty FOR variable.
+ * Fixed bug #1099648 and #1088886 (XML parsing failures on Red Hat)
+ * Fixed bug #1099535 (xml:parse endless loop)
+ * Fixed bug in optimizing fn:count over general-index probes
+ * Fixed bug #866958 (Parsing error not explicit enough)
+ * Fixed bug in computing the static type of a self-axis path step.
+ * Fixed bug #867068: (Incorrect usage of XQDY0027)
+ * Fixed bug: jsoniq constructor should not be const-folded
+ * Fixed bug #1152834 (bug in computing the scripting kind of array and object
+ constructor exprs)
+ * Fixed bug #1125444 (input group-by exprs were not treated by index-flwor_vars()
+ function, leading to erroneous loop hoisting).
+ * Raise XQST0046, if needed, from namespace declaration attribute inside
+ direct element constructor.
+ * Fixed bug #1023362 (xsi:type attribute ignored during validation)
+
+
+version 2.8
+
+New Features:
+ * New external module for interfacing with Couchbase Server.
+ * New external module for interfacing with SQLite Database.
+ * New external module for interfacing with Oracle NoSQL Database.
+ * New external module for interfacing with relational databases via JDBC.
+ * New external info-extraction module for querying concepts and entities in
+ natural language text.
+ * New built-in module to (de)reference XML nodes or JSON objects and
+ arrays that are stored in a collection
+ * Implemented JSONiq's json-doc() function.
+ * http-uri-resolution feature to disable HTTP when resolving URIs.
+ * Option to specify that parse-json() strips the top-level array.
+ * Extended cast and castable expression to allow any simple target type
+ (as specified by XQuery 3.0).
+ * The XQXQ (XQuery-for-XQuery) module became part of the Zorba core.
+ * The datetime module became part of the Zorba core.
+ * In the datetime module, added parse-date(), parse-dateTime(), parse-time(),
+ and utc-offset().
+ * Includes test driver for W3C XQuery 3.0 Test Suite (aka FOTS).
+
+Optimizations:
+ * Various optimizations in the implementation of the optimizer rules.
+ * Better computation of the static type for global variables.
+ * Optimization of comparison operators when untypedAtomic items are involved.
+ * Improved computation of static type for fn:data function.
+ * Fixed iteration over the components of a window clause; this improves static
+ type computation of expressions referencing window vars.
+ * No need to cast xs:untypedAtomic to xs:string in order-by expression.
+ * Convert LET variables whose domain sequence has exactly one item to FOR
+ vars.
+
+Bug Fixes/Other Changes:
+ * Fixed bug #949064 (faulty QName should be printed in the error message)
+ * Fixed bug #1072644 (broken parser error location)
+ * Fixed bug #868640 (Node lifetime is shorter than expected due to let
+ variable inlining)
+ * Fixed bugs #1081626 (Segmentation fault in a side-effecting FLWOR),
+ #1079488 (streaming segfault)
+ * Fixed bug #1062093 (bug in var reference iterators with an associated
+ position that is negative)
+ * Fixed bug #1073978 (FOTS: option default ns not supported)
+ * Fixed bug #1061222 (bad message for errors in index key type declaration)
+ * Fixed bug #1065175 (preceding::node()[1] returns wrong results)
+ * Fixed bug #1065321 (following:text() doesn't return results in doc order)
+ * Fixed bug #1067706 (wrong const folding in mutually recursive udfs)
+ * Fixed bug #1021492 (while computing the "sources" of a prolog var, skip any
+ var-setting exprs that appear in non-used (and non-optimized) functions).
+ * Fixed bug #1070551 (zerr:ZOSE0003 stream read failure)
+ * Fixed bug #992304 (Compiling library modules could load data from wrong
+ source).
+ * Fixed bug #1043294 (XQST0036 not used in XQuery 3.0).
+ * Fixed bug in castable expr when the target type is xs:QName.
+ * Fixed bug in testing if a sequence type is subtype of node(xs:untyped)
+ * Fixed mustCopyInputNodes() method of no-copy, and jsoniq functions.
+ * Fixed bugs related to casting to user-defined types.
+
+
+version 2.7
+
+New Features:
+ * XQuery 3.0 simple map operator http://www.w3.org/TR/xquery-30/#id-map-operator
+ * Copy function added to the node module
+ * Allow prolog variables to be referenced before they are declared (XQuery 3.0 feature)
+ * Module http://www.jsoniq.org/modules/function-library with handy JSONiq functions
+ * jn:parse-json can parse multiple top-level JSON items
+ * New semantics of null for comparison and arithmetics operations
+ * xml:parse (fragment parsing) now allows for a DOCTYPE declaration at the
+ beginning of the XML document (requested in bug #1016606).
+ * Roundtripping of JSON items has been moved from the serializer to encoding functions.
+ * Added uuid to public API.
+ * Best-effort serialization of atomic values in JSON items.
+ * Positional pagination support for index probes
+ * Recognize the {http://www.zorba-xquery.com/extensions}no-copy pragma to avoid
+ copying nodes before insertion into a collection.
+ * Added createUntypedAtomic to API's ItemFactory.
+ * new xqDoc feature; reporting collections and indexes
+ * new xqDoc function parameter to enable/disable xqDoc generation of certain
+ components
+ * Adding new external module read-pdf, it converts PDF documents to text or rendered images.
+
+Optimizations:
+ * Improved memory management for compiler expressions (no more ref counting)
+ * Extended optimization rules (for variable inlining/elimination and positional
+ predicate rewrite) to general flwor expressions.
+ * Early optimization of positional predicates to subsequence expressions: now
+ done at translation time, if possible.
+ * For non-mutable global variables, assign a type based on their initializing expr.
+ * Use char* instead of zstring as the hashmap key in json objects
+ * Removed document-order sorting after the index value probe functions.
+ * Optimize positional predicates involving inequality (convert them to subsequence)
+ * Optimize positional predicate that is in CNF with other predicates.
+ * Optimized runtime group iterator based on latest group-by semantics.
+ * Removed two unnecessary steps from optimizer.
+
+Bug Fixes/Other Changes:
+ * Fixed bug #1006960 (taking construction mode into account during no-copy rule)
+ * Fixed bug #950621 (Removed two-arg version of fn:parse-xml(); use XML module
+ function xml:parse() instead)
+ * Fixed bug #867227 (Improved error message for missing commas)
+ * Fixed memory leak during runtime group-by"
+ * Fixed bug #1024033 and #1023170 (segfaults in parse-xml:parse())
+ * Fixed bug #898792 (Dynamically computed strings can now be cast to xs:QName)
+ * Fixed bug in determining the IsId property of constructed attribute nodes
+ * Fixed bug #1034990 (text serialization with jsoniq fails)
+ * Fixed bugs #899364 and 899363 (throw XQST0103 in case of non-distinct window
+ variables)
+ * Fixed bug #923686 (implicitly declare global context size and context position
+ variables in main module and provide api function to assign values to these
+ variables)
+ * Fixed bug #899366 (enforce the type declaration of a window variable)
+ * Fixed bug #1034942 (improper variable inlining inside general flwor expr)
+ * Fixed bug #1024892 (index declaration references udf declared after the index)
+ * Fixed bug #1038410 (Memory leaks in parser, trace iterator, and general index)
+ * Fixed bug #1046411 (automatic boxing of multi-item sequence appearing as the
+ value of an object pair)
+ * Fixed bug #1046410 (automatic conversion to null of empty sequence appearing
+ as the value of an object pair)
+ * Fixed bug #1039488 (inserting more than one pair at once in a JSON object)
+ * Fixed bug #1042840 (QName pool free-list corruption)
+ * Fixed bug #866984 (better error message for an eval error)
+ * Fixed bug #1047538 (SourceFinder::findLocalNodeSources missing json expressions)
+ * Fixed bug #932374 (FOTS fn:matches failing tests)
+ * Fixed #1052383 (accessing context item in eval expr)
+ * Fixed bug #1046559 (dynamic resolution between function invocation and jsoniq
+ navigation)
+ * Fixed bug #932884 (HTML and XHTML serialization of empty elements)
+ * Fixed bug #1046415 (pair name cast to string)
+ * Fixed bug #1045902 (file:last-modified returns current date time)
+ * Fixed bug #1043976 (compiler warning in serializer code)
+ * Fixed bug #866994 (a better error message when collection iterator not open)
+ * Fixed bug #1039254 (allow empty sequence as position value in positional LET
+ var iterator)
+
+
+version 2.6
+
+New Features:
+ * Include first-class support for JSON data by implementing the JSONiq spec
+ - see http://jsoniq.org/ for more information. This feature is enabled by default.
+ * Implemented the new EQName syntax (use Q{namespace}local instead of "namespace":local)
+ * New function Item::isSeekable for streamable content (xs:string and xs:base64Binary)
+ * Implemented the latest W3C specification for the group by clause (backwards incompatible)
+ * New ft:tokenize-nodes() function to full-text module
+ * New XQuery 3.0 function fn:parse-xml-fragment#1
+ * New ItemFactory function that allows creating dateTime items without timezone
+ * Added support for transient maps to the
+ http://www.zorba-xquery.com/modules/store/data-structures/unordered-map module.
+ * Added support for fragments to fn:path
+ * Positional pagination support for collections
+ * Pagination by reference support for collections
+ * http://www.zorba-xquery.com/modules/archive module for creating,
+ reading, and updating various (compressed) archives (e.g. zip, tar.gz,
+ or tar.bz2)
+ * Incremental maintenance for general indexes
+ * New function in the http://www.zorba-xquery.com/modules/store/static/indexes/dml
+ module which returns the value of all keys contained in an index
+
+Optimizations:
+ * Optimization of comparison operations
+ * Tighter hoisting of expressions (also fixes bug #967428)
+ * Optimized hash sets used by fn:distinct-values and nodes-distinct
+ * Optimized hash function used for nodes (also fixes bug #1010051)
+ * Rewrite of plan serializer internals, resulting in big performance improvement
+ * Avoid treat expr for checking that the value of a non-external
+ global variable conforms to the type declaration of the variable
+ * Streaming execution for tumbling windows (also fixes bug #1010051)
+
+Bug Fixes/Other Changes:
+ * Fixed bug #1025622 (Incorrect JSON serialization of supplementary plane code points)
+ * Fixed bug #1016606 (DOCTYPE in the input of the parse-fragment function)
+ * Fixed bug #1002993 (bug during revalidation after update; improper condition
+ for calling TypeOps::get_atomic_type_code() from
+ SchemaValidatorImpl::isPossibleSimpleContentRevalImpl())
+ * Fixed bug #867357 (Improved parser error messages)
+ * Fixed bug #1026379 ("q" flag for fn:replace() is ignored)
+ * Fixed bug #932314 (non-comparable values must be treated as distinct by
+ fn:distinct-values)
+ * Fixed bug #1015580 (Add base64_streambuf / replace inefficient base64 code)
+ * Fixed bug #1022557 (subsequence function applied on window variable)
+ * Fixed bug #9910884 (raise XUST0001 in trycatch with mixed updating and simple clauses)
+ * Fixed bug #854506 (ugly type error messages) and partial fix for bug #867008
+ * Fixed bug #1008082 (bug in transform expr when a copy var is not used anywhere)
+ * Fixed bug #898066 (Stringstream & fn:trace)
+ * Fixed numbering of items in fn:trace starts with one
+ * Fixed bug #1003023$ (optimizer problems due to common subexpression after
+ var folding into if-then-else)
+ * Fixed bug #1006166 (disabling 2 functions with the same qname)
+ * Fixed bug #960083 (improper error handling of NaN comparisons)
+ * Fixed bug #878508 (JsonML serialization not escaping characters)
+ * The XML plan serialization format is not supported anymore
+
+
+version 2.5
+
+New Features:
+ * New XQuery 3.0 functions
+ - fn:available-environment-variables
+ - fn:environment-variables
+ - fn:uri-collection
+ - fn:unparsed-text
+ - fn:unparsed-text-available
+ - fn:has-children#0
+ - fn:nilled#0
+ - fn:path
+ * Added base64:decode#2 function which also does transcoding
+ * Extended API for Python, Java, PHP and Ruby
+ * Added JVM classpath to zorbacmd and to Zorba API
+ * Added full-text module
+ * Added support for NO_ICU (to not use ICU for unicode processing)
+ * Added XQJ support
+ * Added CollectionManager and DocumentManager support for XQJ
+ * Added new API EntityKind SOME_CONTENT
+ * Added new API StreamResource which is able to specify whether a
+ stream is seekable or not.
+ * Added new functions in the fetch module and the StaticContext to fetch
+ resources as binary
+ * Added non-core schema-tools module for getting sample XMLSchema from
+ XML instances and sample XML instances from XMLSchema.
+
+Optimizations:
+ * optimized insertion into a collection (don't copy it if the node was
+ created by an element constructor and is not used anywhere else in the query)
+ * Fixed performance problem with the findNodeSources function of the no-copy rule
+
+Bug Fixes/Other Changes:
+ * Fixed bug #867170 (Variables declared in Prolog are Overwritten inside the query)
+ * Fixed bug #1001463 (type not available during computation of function caching)
+ * Fixed bug #1002867 (resulting base64 in http-client is wrong)
+ * Fixed bugs #905028 (Allow to set base URI to undefined)
+ * Fixed bugs #931501 and #866987 (improved error messages for fn:format-number()
+ * fn:format-number raises FODF1310 instead of XTDE1310
+ * Fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)
+ * Fixed bug #862971 (no error upon duplicate function declarations)
+ * Fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions)
+ * Fixed bug #986075 (encountering flwor expr with no clauses)
+ * Fixed bug #967864 (var substitution did not update theFreeVars property)
+ * Fixed bug #891650 (context size var not always declared within path expr)
+ * Fixed bug #948879 (--uri-path doesn't work with fetch:content())
+ * Fixed bug in MarkNodeCopyProps rule (static cast to replace_expr without chaing the expr kind first)
+ * Fixed bug in window iterator (binding the end vars in the output tuple stream)
+ * Fixed bug #866547 (protect index-join rule from general flwor)
+ * Fixed bug #867253 (cdml:delete-nodes should only remove root nodes)
+ * Fixed bug #967428 (do not hoist index creation outside a try-catch)
+ * Fixed bug #872234 (prevent a rewritting to take place in case of sequential expr)
+ * Fixed bug #966706 (key uniqueness of index not enforced during incremental refresh)
+ * Fixed bug #906494 (default compile with D_FILE_OFFSET_BITS=64)
+ * Fixed bug #988412 (date:current-dateTime daylight saving)
+ * Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)
+ * Fixed bug #986377 (do not apply any updates on collection if it is to be truncated)
+ * Fixed bug #921458 (file:read-text-lines() blocking)
+ * Fixed bug #981405 (do not hoist expr containing try-catch variables out of the associated try-catch expression)
+ * Fixed bug #996084 (crash in Streamable*Item with file module)
+ * Fixed bug #947627 (throw XQST0099 if more than one declarations of context item type in same module)
+ * Fixed bug #980526 (no-copy rule bug due to global var being set in "distant" udf)
+ * Fixed bug #949910 (has-children may be invoked on all nodes)
+ * Fixed Bug #933490 (Error ItemFactoryImpl::createBase64Binary with istream)
+ * Fixed bug #867112 (Diagnostic Handler was not working on external APIs)
+ * Fixed bug #857842 (Assertion failed with simple content element with comments)
+ * Fixed bug #928626 (no setting classpath in xsl-fo module)
+
+version 2.2
+
+New Features:
+ * Add --compile-plan (-c) and --execute-plan (-e) options to zorba command line.
+ * Add XQuery 3.0 concat operator (http://www.w3.org/TR/xquery-30/#id-string-concat-expr)
+ * New URI module providing percent-decoding functions.
+ * The core parse-xml module is now able to parse input files in a streaming mode. A number of new options have also been added.
+ * LibXml2 version 2.7.0 or higher is now required in order to build Zorba.
+ * Added index management function to the C++ api's StaticCollectionManager.
+ * Added createDayTimeDuration, createYearMonthDuration, createDocumentNode, createCommentNode, createPiNode to api's ItemFactory.
+ * Fixed bug #905050 (setting and getting the context item type via the c++ api).
+ * Added split function to the string module that allows for streamable tokenization but doesn't have regular expression
+ * Add new XQuery interface for the PHP bindings.
+ * Added two API methods StaticContext::getFunctions to introspect the functions of a static context
+ * Added API method Item::getNamespaceBindings().
+ * Added a transcoding streambuffer to the API which allows transcoding arbitrary encodings
+ from and to UTF-8
+ * file:read-text is able to handle arbitrary encodings (fixes bug #867159)
+ * http:send-request is able to handle arbitrary encodings
+ * Added API method StaticContext::getNamespaceBindings() (see bug #905035)
+ * New version of the JSON converter module in the core of Zorba (no external dependencies anymore)
+ * Added truncate function to the collection modules for efficient deletion of all nodes in a collection.
+
+
+Optimization:
+ * No-copy optimization: avoids copying nodes during node-constructor expressions.
+ * Added external function annotations %ann:propagates-input-nodes and
+ %ann:must-copy-input-nodes to be used by the no-copy optimization.
+ * Caching of results for recursive functions with atomic parameter and return types.
+ * Added %ann:cache and %ann:no-cache to enable or disable caching of results of functions with atomic parameter and return types.
+ * Types-related optimizations for runtime operators (comparisons, FnBoolean, Or, And,
+ Compare, instance-of, cast, castable, treat, promote).
+ * More efficient implementation for base64Binary items
+ * Preallocate and reuse temp sequence iterator for LetVarITerator
+ and CtxVarIterator.
+ * Enhanced push-down of positional predicate into LetVarITerator
+ and CtxVarIterator.
+ * Change the implementation of the free-vars annotation and got rid
+ of the annotations map in expressions.
+
+Bug Fixes/Other Changes:
+ * Fixed bug 923015 (clone() not implemented for full-text expressions)
+ * Fixed bug 917923 (bug in copying outer var values into the eval dynamic context)
+ * Fixed bug 867509 (Can not handle largest xs:unsignedLong values)
+ * Fixed bug 924063 (sentence is incorrectly incremented when token characters end without sentence terminator)
+ * Fixed bug 909126 (bug in cloning of var_expr)
+ * Fixed bug 928631 (external builtin function were not executed in the module they
+ were declared)
+ * Fixed bug in destruction of exit_catcher_expr
+ * Fixed bug #867024 (error messages)
+ * Fixed bug #957580 (stream read failure in StringToCodepointsIteartor)
+ * Fixed bug #911585 (management of variables during eval)
+ * Fixed bug #866423 (fn:empty and fn:exists iterators must reset their input in
+ case of early-out)
+ * Fixed bug #955574 (http-client "hangs" if following a POST request)
+ * Fixed bug #945241 (StaticCollectionManager::declaredIndexes() and temporary indexes)
+ * Fixed bug #872288 (reset recursive flag during node rename)
+ * Fixed bug #905041 (allow for the default element and function namespaces to be
+ set multiple times via the c++ api).
+ * Fixed bug #907872 (segfault when returning an input ItemSequence from an external function).
+ * Fixed bug in codegen: do not create a materialize clause if one exists already
+ support.
+ * Fixed bug involving positional var and groupby
+ * Fixed bug #867266 (do not hoist updating expressions)
+ * Fixed bug #867022 (added location and params to some XPTY0004 errors)
+ * zerr is not predeclared anymore to be http://www.zorba-xquery.com/errors
+ * Fixed bug #917981 (disallow declaring same module twice).
+ * Deprecated StaticContext:getNamespaceURIByPrefix()
+ * Fixed bug #943788 (streamable string is not seekable)
+ * Fixed bug #921624 (slow queries with bogus example.com schema URIs)
+ * Fixed bug #918211 (xqueryx fulltext w3c conformance generation)
+ * Fixed bug #918157 (Add XQFTTS to validation queue)
+ * Fixed bug with unversioned modules with C++ external functions
+ * Fixed bug #912579 (validate-in-place on non-root elements)
+ * Fixed bug #891209 (validation with xsi:type returns untyped)
+ * Fixed bug #952829 (Nondeterministic annotation doesn't seem to be checked)
+ * Fixed bug #951772 (Comment node crashes serialization)
+ * Fixed bug #945241 (StaticCollectionManager::declaredIndexes() and temporary indexes)
+
+
+version 2.1
+
+New Features:
+ * New node-position module. This module allows to obtain a representation of a node position, which
+ can be used to assess structural relationships with other nodes.
+ * New node-reference module. References can be obtained for any node, and
+ different nodes cannot have the same identifier.
+ * Custom Full-text thesaurus using Zorba URI resolver mechanism.
+ * Modified C++ API to add isSequential, getExternalVariables,
+ isBoundContextItem and isBoundExternalVariable Functions
+ * Collection allows to retrieve information about the type
+ and the annotations of a static collection.
+ * Implemented the probe-index-range-value for general indexes
+ * Added ExternalFunctionParameter class to be registered in the DynamicContext
+ * New module for compiling and executing XQueries from XQuery (xqxq)
+ * External functions are allowed to be updating (i.e. return a pending update list)
+
+Optimization:
+ * Optimization for positioned sequence access (e.g. $x[$x[1]] where $x is a
+ sequence of integers)
+ * Optimization for count(collection()) expressions
+ * Optimization of the fn:substring function in the case when its $start and $length arguments
+ are integers
+
+Bug Fixes/Other Changes:
+ * Fixed bug #3403291 (build for Fedora 15)
+ * Fixed bug #3397293 (Incorrect XQueryX error message)
+ * Fixed bug #3398637 (Nested element constructors cause loss of namespace bindings)
+ * Fixed bug #3401592 (Undo of Create Collection doesn't work)
+ * Fixed bug #3404689 (assignment problem in flwor)
+ * Fix for bug #3404450 (testdriver_mt problem: caching and validation of docs)
+ * Fixed installation bug to not install the .so for test modules
+ * Fixed bug #3390410 (Adding a node to a collection causes out of bound in vector)
+ * Fixed bug #3406200 (node types were not being moved to new tree during node detach)
+ * Fixed bug #3406191 (Namespace bindings lost after update due to bug in node detach)
+ * Fixed bug #3290122 (ZDST0003 needs collection name)
+ * Fixed bug #3406272 (merging of adjacent text nodes must be done after all
+ updates have been applied).
+ * Don't raise warnings for unknown annotations.
+ * Fixed bug #3409344 (during detach, if the node being detached is the root of
+ its tree, it should be detached from the tree as well; otherwise memory
+ corruption will occur)
+ * Fixed bug # (Should not destroy the parent of a node that is being detached
+ before the detach is done).
+ * Added const qualifier to StaticContext::getAuditEvent()
+ * Fixed bug #3408181 (available-collection() returns undeclared collections)
+ * Fixed bug #859465 (Fatal error if a PUL contains two deactivate IC primitives)
+ * Fixed bug #859467 (Fatal error if a PUL contains two activate Foreign Key primitives)
+ * Fixed bug #859468 (Fatal error if a PUL contains two activate Simple IC primitives)
+ * Fixed bug #859522 (Fatal error if a PUL contains two delete document primitives)
+ * Fixed bug #859968 (Using put on an attribute produces an invalid XDM instance and may cause segmentation faults)
+ * Fixed bug #855314 (should not fold a constant expr that returns an error item)
+ * Fixed bug when parsing a document with a base-uri attribute.
+ * Fixed bug #863320 (Sentence is incorrectly incremented when token characters end without sentence terminator)
+ * Fixed bug #863730 (static delete-node* functions don't raise ZDDY0012)
+ * Implemented the probe-index-range-value for general indexes
+ * Removed ZSTR0005 and ZSTR0006 error codes
+ * Fixed bug #867662 ("nullptr" warning)
+ * Fixed bug #868258 (Assertion failure with two delete collection)
+ * Fixed bug #871623 and #871629 (assertion failures with insertions in dynamic collections)
+ * Fixed bug #867262 (allow reuse of iterator over ExtFuncArgItemSequence)
+ * Fixed bug #869024 (segmentation fault with node-reference)
+ * Fixed bug #869025 (segmentation fault with node-reference)
+ * New node-reference module. References can be obtained for any node, and
+ different nodes cannot have the same identifier.
+ * Fixed bug #872697 (segmentation fault with validation of NMTOKENS)
+ * General index cannot be declared as unique if the type of its key is
+ xs:anyAtomicType or xs:untypedAtomic.
+ * Added undo for node revalidation
+ * Optimization for count(collection()) expressions
+ * Fixed bug #872796 (validate-in-place can interfere with other update primitives)
+ * Fixed bug #872799 (validate-in-place can set incorrect types)
+ * Fixed bug #855715 (Invalid escaped characters in regex not caught)
+ * Fixed bug #868325 (fn:analyze-string fails with some recursive subgroups)
+ * Fixed bug #872697 (segmentation fault with validation of NMTOKENS)
+ * General index cannot be declared as unique if the type of its key is
+ xs:anyAtomicType or xs:untypedAtomic.
+ * Added undo for node revalidation
+ * Optimization for count(collection()) expressions
+ * Fixed bug #867133 (SWIG PHP build failure on Mac OSX)
+ * Fixed bug #872796 (validate-in-place can interfere with other update primitives)
+ * Fixed bug #872799 (validate-in-place can set incorrect types)
+ * Fixed bug #872850 (Serialization of Tumbling Window For fails)
+ * Fixed bug #855715 (Invalid escaped characters in regex not caught)
+ * Fixed bug #862089 (Split binary/xq install directories for modules) by
+ splitting "module path" into separate URI and Library paths
+ * New node-position module. This module allows to obtain a representation of a node position, which
+ can be used to assess structural relationships with other nodes.
+ * Fixed bug #872502 (validation of the JSON module xqdoc fails)
+ * Fixed bug #897619 (testdriver_mt can not run the XQueryX tests)
+ * Fixed bug #867107 (xqdoc dependency to zorba is wrong)
+ * Fixed bug #897616 (Fix the generation of the XQFTTS report results for
+ W3C)
+
+version 2.0.3
+ * Fixed bug #867662 ("nullptr" warning)
+ * documentation improvements
+
+version 2.0.2
+ * Fixed bug #3401971 (node-by-reference on dynamic collections)
+ * documentation improvements
+ * installer improvements
+ * Fixed bug #3403291 (build for Fedora 15)
+ * Don't install the .so for test modules
+ * Fix for running ctest on Windows
+
+version 2.0.1
+
+ * Custom Full-text stemming.
+ * Custom Full-text tokenization.
+ * Fixed scripting bug where apply statement was considered a sequential expr even if the source expr was non-updating and non-sequential.
+ * Fixed bug #3394400 (Element replacement, really unexpected result)
+ * Fixed bug #3394588 (Unexpected error during pul undo)
+ * Fixed bugs #3398511 and #3398552 with "make install"
+ * Fixed bug #3398521 for compiling with ZORBA_NO_XMLSCHEMA
+
+version 2.0
+ * Zorba 2.0 is a major rewrite of previous versions. It doesn't claim to
+ preserve backwards compatibility with any 1.X version.
+ Host language API changes have been made to the following components:
+ - External functions API
+ - XmlDataManager
+ - Error reporting
+ - Debugger API
+ XQuery language and API changes have been made to the following components:
+ - XQuery Scripting Extension
+ - Function APIs
+ - XQuery Data Definition Facility
+ - XQuery modules and module versioning
+ - Changes to conform with the latest XQuery 3.0
+ - Namespaces of annotations, errors, collations.
+ * In addition to host language API and XQuery language improvements,
+ plenty of bug fixes and optimizations have been made.
+
+version 1.4
+ * added a datetime library module with nondeterministic functions
+ * new nondeterministic read functions in the http-client module
+ * the http-client's send-request function accepts a non-validated request parameter
+ * fixed an issue with a wrong static context being used in eval queries (see bug item #2979317)
+ * added XQuery 1.1 Switch expressions (only available in 1.1 processing mode)
+ * added the fn:parse function from XQuery Functions and Operators 1.1
+ * improved error reporting for parser errors
+ * improved error reporting for errors regarding sequential expressions
+ * bug fixes
+ - accept relative URIs in xs:anyURI constructors (#2988209)
+ - direct element/attribute construction (#2999765)
+ - deep-equal (#2999772)
+ - schema-attribute(*) is parsed as a function call instead of a node test (#2993286)
+ - handling xml:base attributes during doc loading (#3013096)
+ - fixed build with CMake 2.6.0 on Debian Lenny
+ - try-catch error if XQuery version < 1.1 (#3005344)
+ - W3C test suite bugs CastableAs649 and CastableAs650 (#2999777)
+ - assertion in StatelessExtFunctionCallIterator (#3012651)
+ - http-client return type handling for (*+xml and text/html)
+ * optimization of fn:subsequence
+ * new xqDoc function (xqdoc-content) taking a documented module as string
+ * new xqDoc feature; reporting functions invoked from within a particular function
+ * xqDoc schema change; name element for functions got an arity attribute
+ * added a tidy library module that provides functions to tidy an HTML string
+ and returns a valid XHTML document node (http://www.zorba-xquery.com/modules/tidy)
+ * added a schema library module that provides XML schema related functions (e.g. schema-type)
+ (http://www.zorba-xquery.com/modules/schema)
+ * added a node reference library module that provides functions to retrieve the URI
+ of a node and vice versa (http://www.zorba-xquery.com/modules/reference)
+ * added a hmac module (http://www.zorba-xquery.com/modules/security/hmac)
+ that provides an sha1 function (e.g. used in OAuth)
+ * added a random module (http://www.zorba-xquery.com/modules/random)
+ that provides fuctions for generating (pseudo-)random integers and UUIDs.
+
+version 1.2
+ * more introspection functions (e.g. in-scope-element and in-scope-attribute)
+ * first prototype for higher order functions from XQuery 1.1
+ * JSON module in (com/zorba-xquery/www/modules/json)
+ * huge performance improvements
+ * added an Atom schema to the build-in schemas
+ * register a callback function in the static context that is called
+ if a collection or index declaration is processed (compiled)
+ * nondeterministic (instead of sequential) functions in the file module
+ * reference counting the store (de)initialization
+ * many bug fixes; for example
+ - compile with Xerces 3.1
+ - loading external functions (prefix problem)
+ - plan serializer fixes
+ - serialization fixes
+ - base64 decoder
+ - loading documents with general entities
+ - EXPATH http-client fixes
+ - not hoisting nondeterministic functions
+ - scripting related fixes
+ - unicode related fixes (e.g. for parameters to the doc function)
+ - StaticContext::loadProlog fix
+ - SAX serialization fix
+
+version 1.0
+ * Changes in the C++ API
+ * Removed ResultIterator class. All public API methods use simply
+ Iterator.
+ * Added a new class named ExternalModule.
+ This class must be used for registering external functions.
+ This change makes the external function API incompatible with
+ previous releases.
+ * Loading pre-compiled queries (using loadExecutionPlan) requires to pass
+ a SerializationCallback which is used for
+ retrieving registered uri resolvers or trace streams.
+ Moreover, the callback is used for retrieving ExternalModules
+ which have been used when compiling the query.
+ * Changed the append function in zorba::String to const. Now, the
+ function does not change the String itself, but returns a new
+ String. Furgthermore zorba::String::append can now handle other
+ zorba::String objects - not only const char*. Also the operators
+ + and += are defined on zorba::String.
+ * Other language bindings (Java, PHP, python, ruby) also now use
+ simply Iterator; ResultIterator removed.
+ * XQC (C language binding) brought up-to-date with latest revision
+ of that spec (https://xqc.sourceforge.net).
+ * Resolving of modules is now enhanced by the so called "Zorba
+ Module Path". Moreover, multiple ModuleURIResolvers can be
+ registered in one StaticContext. See the documentation for more
+ information.
+ * Added static and dynamic context introspection modules.
+ * Added the excel library to the built-in modules.
+ Implemented the most used excel functions.
+ * Added the math library to the built-in modules (the namespace has
+ changed to http://www.zorba-xquery.com/modules/math)
+ * Pass the Static- and DynamicContext as parameter to the evaluate function
+ of external functions.
+ * The XQuery class got a setTimeout option that allows the user to set a
+ maximum running time of a particular query execution.
+ * The StatelessExternalFunction is now non-pure by default. There is
+ a new subclass called PureStatelessExternalFunction which should
+ be used instead. PureStatelessExternalFunctions don't have access
+ to the Static- and DynamicContext.
+ * Renamed XQuery::serialize to XQuery::execute. The new method also
+ implements the functionality of the XQuery::applyUpdates method
+ (which was removed).
+ * Added the serialize library to the built-in modules. The function
+ util:serialize-to-string has been removed.
+ * The DynamicContext can be used to pass arbitrary name-value pairs
+ to the evaluate method of external functions.
+ * Implemented CSV to XML converters. See csv2xml.xq module.
+ You can convert back and forth between CSV files and XML
+ or formated text files and XML.
+ * Changes in the email functionnality
+ * implemented smtp:send functions as external functions
+ * added support for MIME messages (Text in character sets other
+ than ASCII, Non-text attachments, Message bodies with multiple
+ parts, Header information in non-ASCII character sets)
+ * most of the runtime iterators and functions are generated
+ (see https://sourceforge.net/apps/mediawiki/zorba/index.php?title=Creating_New_Runtime_Iterators_and_Functions)
+ * improved exception messages raised by the serializer
+ * Json is now able to parse Unicode messages
+ * improved functionality for java, php, python and ruby bindings.
+
+version 0.9.8-rev1 (2009.09.22)
+ * bug fixes
+ * fixed a crash caused by converting long integers (> 1024 digits)
+ to string
+ * the compile-only check reports the URI of the encapsulating
+ entity in it's error report (used for XQDT semantic checking)
+ * fixed 'for $x in () return $x/test' to return the empty sequence
+ instead of raising a static error
+ * fixed build using Xerces-C 3.0.1
+ * fixed build for Mac OS X 10.6 (Snow Leopard)
+ * improved error reporting in the command line utility
+ * improved detection of the installed version of Xerces-C (raise
+ an error if a wrong version is installed)
+
+version 0.9.8 (2009.08.26)
+ * More XQuery Scripting Features
+ * default initialization for external variables
+ * block local variables
+ * XQuery 1.1
+ * Support for the "validation as TypeName" feature
+ * Changed the try/catch syntax as specified in XQuery 1.1 (except
+ the try- and catch expressions are ExprSingle and not Expr).
+ * Examples for the Java API
+ * Function library
+ * creating PDFs using XSL Formatting Objects (requires Java)
+ * util:parse function
+ * converter functions to/from JSON or JsonML and XML
+ * function for sending simple text emails
+ * the util:tidy function returns a node instead of a string.
+ * XQDoc module http://www.zorba-xquery.com/zorba/xqdoc-functions
+ * Added a loadProlog function to the static context.
+ * Added support for XQueryX and XQueryX Update
+ * Added compiled query persistence to the C++ API
+ (XQuery::loadExecutionPlan() and XQuery::saveExecutionPlan())
+ * Added a printPlan function to the XQuery class of the API.
+ * Added new option in the Zorba command line utility: compile-only,
+ parse-only, lib-module, print-errors-as-xml.
+ * Added two plan printing function (printPlanAsXML and
+ printPlanAsDOT) to the SWIG generated APIs.
+ * Implemented 'declare option': options are set in the static context.
+ * fn:trace can be disabled by setting the option
+ QName("http://www.zorba-xquery.org/option", "trace") to "disable".
+ * Changed the scripting syntax of the exit expression from 'exit
+ with' to 'exit returning'.This is due to an ambiguity in the
+ grammar (see http://www.w3.org/Bugs/Public/show_bug.cgi?id=6852
+ for more information).
+ * Added accessor functions for node items to the Item class in the
+ API (i.e. getChildren, getAttributes, and getNodeName).
+ * Added a UserException to the API which is raised if the user makes
+ a call to the fn:error function.
+ * UTF8 support for the lexer
+ * bug fixes and performance improvements
+
+version 0.9.5 (2008.02.17)
+ * Unified the Tidy and Rest API's
+ * Added new sinatures to zorba-util:tidy and zorba-util:tdoc that
+ allow setting of tidy functions
+ * Added Schema imports using target namespace or location hints
+ * Added StaticContext::findFunctions and StaticContext::disableFunciton
+ * Added Functions for collections
+ * Windows packages include a zorba_simplestore.dll
+ * Improved error messages for regular expression processing
+ * Added functions to return an item instead of xs:string
+ * Added a new signature to zorba-util:random in order to be able to call
+ random within a loop and get different numbers each time.
+ * Corrected the types of some functions/operators (YM_DURATION or
+ DT_DURATION instead of DURATION).
+ * Now possible to pass empty sequence as collection URI.
+ * Now cURL is set to follow an infinite number of redirects.
+ * Added validate after update
+ * Fixed schema files without target namespace.
+ * Fixed notation cast.
+ * Added list and union item types to type manager cache
+ * Added validation tests for schema substitution groups
+ * Added message when error during update test driver.
+ * Added partial support for scripting (XQSE)
+ * Added support "default element namespace" schema imports
+ * Added support variable initializers that refer to forward variable
+ declarations.
+ * Various bug fixes and performance enhancements.
+
+version 0.9.4 (2008.10.06)
+ * added General FLWOR (GFLWOR)
+ * added Windowing functionality
+ * added ability to perform "outer" joins in the FLWOR with outer
+ for clauses
+ * output numbering added to FLWOR
+ * Added HTTP support to module import
+ * fn:parse() is implemented as per the XQuery proposal
+ * Extended api to register user-defined URI resolvers for documents,
+ collections, schemas, and modules
+ * boost dependencies removed
+ * Added xquery debugging support
+ * Added a store implementation based on Windows DOM.
+ * Added functions to make calls to REST based web services through XQuery
+ * Added PHP bindings to zorba
+ * Added tidy support to convert web pages into xhtml.
+ * Added XML Schema support for validation
+ * Added the ability to revalidate XML data with respect to a Schema
+ after applying updates
+
+version 0.9.21-4303 (2008.06.26):
+ * fixed installation problem for python and ruby language bindings
+ * fixed some valgrind reported memory problems
+ * other minor bug fixes and performance improvements
+
+version 0.9.2-4251 (2008.06.19):
+ * Module support (as in the XQuery 1.0 W3C recommendation)
+ * Removed boost shared pointers from the API
+ * Performance improvements and bug fixes
+ * C API (zorbac.h)
+ * Rudimentary SWIG interface for generating other language bindings
+ (i.e. Ruby and Python)
+ * Added support for running multiple queries in the command line utility
+ * group by (as in the evolving W3C XQuery 1.1 recommendation)
+ * try-catch (as in the evolving W3C recommendation)
+ * eval facility to dynamically evaluate a string and execute it as a query
+ * some math functions (e.g. sqrt, sin, cos, etc)
+ * Basic schema validation (without post schema validation and
+ substitution groups)
+ * Stabilized the Store API & build the simplestore as a separate library
+
+version 0.9.1 (2008.04.30):
+ * Initial release supporting
+ * XQuery 1.0 and XPath 2.0 (as in the W3C recommendation)
+ except modules and only limited support for schema validation
+ * XQuery Update Facility 1.0 (as in the evolving W3C recommendation)
+ * An In-Memory (replaceable) XML store
+ (implements the XQuery Data Model (XDM) W3C recommendation)
+ * This release 0.9 passes 97.6% of the W3C tests of XQuery 1.0 test suite
+ and 99.4% of the XQuery Update Facility test suite.
=== added file 'KNOWN_ISSUES.txt'
--- KNOWN_ISSUES.txt 1970-01-01 00:00:00 +0000
+++ KNOWN_ISSUES.txt 2013-08-27 22:37:07 +0000
@@ -0,0 +1,52 @@
+This is a list of issues that we are aware of but are not imlemeneted or fixed:
+
+Zorba Version 2.0
+
+* Floating-point precision problems.
+ For details, see the following bugs:
+ - 2204089 <https://bugs.launchpad.net/zorba/+bug/sf-2204089>
+ - 2205034 <https://bugs.launchpad.net/zorba/+bug/sf-2205034>
+ - 2210851 <https://bugs.launchpad.net/zorba/+bug/sf-2210851>
+
+* When using the (now default) xs:integer representation of a C++ "long long",
+ the largest xs:unsignedLong values are not handled correctly.
+ For details, see the following bug:
+ - 3323548 <https://bugs.launchpad.net/zorba/+bug/sf-3323548>
+
+* Zorba uses ICU for regular expressions that does not support range
+ subtraction. For details, see the following bug:
+ - 3150856 <https://bugs.launchpad.net/zorba/+bug/sf-3150856>
+
+* If you link against ICU <= 3.8.1, you can get wrong results when using \s to
+ match a white space character. For details, see following bug:
+ - 3155900 <https://bugs.launchpad.net/zorba/+bug/sf-3155900>
+
+* A known bug in Xerces < 3.0, when an .xsd contains an any wildcard with
+ namespace #others and the instance contains an element without a namespace,
+ there should still be an error. See "Definitive XMLSchema" by Priscilla
+ Wamsley, p. 279. This was fixed in Xerses > 3.0.
+ For details, see following bug:
+ - 3137594 <https://bugs.launchpad.net/zorba/+bug/sf-3137594>
+
+* XQuery Full-Text is mostly, but not completely, implemented.
+ For details, see following bugs:
+ - 3172383 <https://bugs.launchpad.net/zorba/+bug/sf-3172383>
+ - 3187470 <https://bugs.launchpad.net/zorba/+bug/sf-3187470>
+ - 3187462 <https://bugs.launchpad.net/zorba/+bug/sf-3187462>
+
+* The serializer currently doesn't implement character maps as specified
+ (http://www.w3.org/TR/xslt-xquery-serialization/#character-maps)
+
+* In the 2.0 release, setting the CMake variables ZORBA_NO_ICU to
+ ON is not supported.
+
+* The PHP language binding is not supported on Mac OS X. For details,
+ see the following bug:
+ - <https://bugs.launchpad.net/zorba/+bug/sf-3371525>
+
+* Generating the XQDoc documentation on Windows using nmake is broken,
+ see the following bug:
+ - <https://bugs.launchpad.net/zorba/+bug/sf-3393173>
+
+* The Scripting Extension's features break and continue are not
+ implemented if used within a FLWOR Statement.
=== added file 'LICENSE.txt'
--- LICENSE.txt 1970-01-01 00:00:00 +0000
+++ LICENSE.txt 2013-08-27 22:37:07 +0000
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
=== added file 'NOTICE.txt'
--- NOTICE.txt 1970-01-01 00:00:00 +0000
+++ NOTICE.txt 2013-08-27 22:37:07 +0000
@@ -0,0 +1,740 @@
+-----------
+Zorba 2.8.0
+-----------
+
+(Note: This file is generated automatically from NOTICE.xml.
+Please do not modify this file directly.)
+
+
+
+
+Apache 2
+
+ Copyright 2006-2011 The FLWOR Foundation
+
+ See LICENSE.txt for license information.
+
+ ------------------------
+ This product includes software developed at
+ The FLWOR Foundation (http://www.flworfound.org/).
+
+ ------------------------
+ Portions of this software were developed at the Systems
+ Group of the ETH Zurich, Switzerland.
+
+
+Other files used by this project:
+----------------------------------------------------
+
+src/zorbatypes/m_apm.h
+src/zorbatypes/mapm/
+
+Copyright: 1999-2007 Michael C. Ring
+Website: http://www.tc.umn.edu/~ringx004/mapm-main.html
+
+ This software is Freeware.
+
+ Permission to use, copy, and distribute this software and its
+ documentation for any purpose with or without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and
+ that both that copyright notice and this permission notice appear
+ in supporting documentation.
+
+ Permission to modify the software is granted. Permission to distribute
+ the modified code is granted. Modifications are to be distributed by
+ using the file 'license.txt' as a template to modify the file header.
+ 'license.txt' is available in the official MAPM distribution.
+
+ To distribute modified source code, insert the file 'license.txt'
+ at the top of all modified source code files and edit accordingly.
+
+ This software is provided "as is" without express or implied warranty.
+
+----------------------------------------------------
+
+src/zorbamisc/config/stdint.h
+
+Copyright: 2006 Alexander Chemeris
+
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. The name of the author may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------
+
+src/zorbautils/stemmer/
+
+Copyright: 2001 Dr. Martin Porter
+
+
+ All the software given out on this Snowball site is covered by the BSD
+ License (see http://www.opensource.org/licenses/bsd-license.html), with
+ Copyright (c) 2001, Dr Martin Porter, and (for the Java developments)
+ Copyright (c) 2002, Richard Boulton.
+
+ Essentially, all this means is that you can do what you like with the code,
+ except claim another Copyright for it, or claim that it is issued under a
+ different license. The software is also issued without warranties, which
+ means that if anyone suffers through its use, they cannot come back and sue
+ you. You also have to alert anyone to whom you give the Snowball software to
+ the fact that it is covered by the BSD license.
+
+ We have not bothered to insert the licensing arrangement into the text of
+ the Snowball software.
+
+----------------------------------------------------
+
+src/util/less.h
+
+Copyright: 1998 Paul J. Lucas
+
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ o Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ o The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------
+
+src/util/auto_vector.h (has been modified)
+
+Copyright: 2003 Reliable Software
+
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ o Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ o The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------
+
+cmake_modules/FindBoost.cmake
+
+Copyright:
+ 2006-2008 Andreas Schneider <mail@xxxxxxxxxxxx>
+ 2007 Wengo
+ 2007 Mike Jackson
+ 2008 Andreas Pakulat <apaku@xxxxxx>
+
+
+
+ Redistribution AND use is allowed according to the terms of the New BSD license.
+ For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+----------------------------------------------------
+
+cmake_modules/FindJNI.cmake
+cmake_modules/FindPythonLibs.cmake
+cmake_modules/FindSWIG.cmake
+
+Copyright: 2001-2009 Kitware, Inc.
+
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the names of Kitware, Inc., the Insight Software Consortium,
+ nor the names of their contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ ------------------------------------------------------------------------------
+
+ The above copyright and license notice applies to distributions of
+ CMake in source and binary form. Some source files contain additional
+ notices of original copyright by their contributors; see each source
+ for details. Third-party software packages supplied with CMake under
+ compatible licenses provide their own copyright notices documented in
+ corresponding subdirectories.
+
+ ------------------------------------------------------------------------------
+
+ CMake was initially developed by Kitware with the following sponsorship:
+
+ * National Library of Medicine at the National Institutes of Health
+ as part of the Insight Segmentation and Registration Toolkit (ITK).
+
+ * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
+ Visualization Initiative.
+
+ * National Alliance for Medical Image Computing (NAMIC) is funded by the
+ National Institutes of Health through the NIH Roadmap for Medical Research,
+ Grant U54 EB005149.
+
+ * Kitware, Inc.
+
+----------------------------------------------------
+
+/xml.xsd
+
+Copyright: 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
+
+
+ All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+ W3C Software Notice and License
+
+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+ License
+
+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+ Disclaimers
+
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+
+----------------------------------------------------
+
+schemas/xslt-xquery-serialization.xsd
+
+Copyright: 2010 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
+
+
+ All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+ W3C Software Notice and License
+
+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+ License
+
+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+ Disclaimers
+
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+
+----------------------------------------------------
+
+modules/w3c/xpath-functions.xsd
+
+Copyright: 2005 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
+
+
+ All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+ W3C Software Notice and License
+
+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+ License
+
+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+ Disclaimers
+
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+
+----------------------------------------------------
+
+include/xqc.h
+
+Copyright: 2008, Matthias Brantner, John Snelson
+
+
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the developers nor the names of contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------
+
+modules/functx/functx.xq
+
+Copyright: 2007 Datypic
+
+
+ : 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+----------------------------------------------------
+
+src/compiler/parser/FlexLexer.h
+
+Copyright: 1993 The Regents of the University of California
+
+
+ // All rights reserved.
+ //
+ // This code is derived from software contributed to Berkeley by
+ // Kent Williams and Tom Epperly.
+ //
+ // Redistribution and use in source and binary forms, with or without
+ // modification, are permitted provided that the following conditions
+ // are met:
+
+ // 1. Redistributions of source code must retain the above copyright
+ // notice, this list of conditions and the following disclaimer.
+ // 2. Redistributions in binary form must reproduce the above copyright
+ // notice, this list of conditions and the following disclaimer in the
+ // documentation and/or other materials provided with the distribution.
+
+ // Neither the name of the University nor the names of its contributors
+ // may be used to endorse or promote products derived from this software
+ // without specific prior written permission.
+
+ // THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ // IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ // PURPOSE.
+
+----------------------------------------------------
+
+src/diagnostics/StackWalker.cpp
+src/diagnostics/StackWalker.h
+
+Copyright: 2005 Jochen Kalmbach
+
+
+ Under BSD License: http://www.opensource.org/licenses/bsd-license.php
+
+----------------------------------------------------
+
+src/util/singleton.h
+src/util/threads.h
+
+Copyright: 2001 Andrei Alexandrescu
+
+
+ This code accompanies the book:
+ Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
+ Patterns Applied". Copyright (c) 2001. Addison-Wesley.
+ Permission to use, copy, modify, distribute and sell this software for any
+ purpose is hereby granted without fee, provided that the above copyright
+ notice appear in all copies and that both that copyright notice and this
+ permission notice appear in supporting documentation.
+ The author or Addison-Wesley Longman make no representations about the
+ suitability of this software for any purpose. It is provided "as is"
+ without express or implied warranty.
+
+
+External libraries used by this project:
+----------------------------------------------------
+
+Name: LIBXML2
+Preferred version: 2.2.16 or higher
+Is mandatory: true
+Website: http://xmlsoft.org/
+License: MIT
+Copyright: 1998-2002 Daniel Veillard. All Rights Reserved.
+External notice:
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name of Daniel Veillard shall not
+ be used in advertising or otherwise to promote the sale, use or other deal-
+ ings in this Software without prior written authorization from him.
+
+----------------------------------------------------
+
+Name: LIBXSLT
+Preferred version: 1.1.26
+Is mandatory: false
+Website: http://xmlsoft.org/XSLT/
+License: MIT
+Copyright: 2001-2002 Daniel Veillard. All Rights Reserved.
+External notice:
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+ Except as contained in this notice, the name of Daniel Veillard shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from him.
+
+
+----------------------------------------------------
+
+Name: ICU4C
+Preferred version: 3.6 or higher
+Is mandatory: true
+Website: http://www.icu-project.org/
+License: ICU License
+Copyright: 1995-2011 International Business Machines Corporation and others
+External notice:
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+ Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
+
+----------------------------------------------------
+
+Name: CURL
+Preferred version: above 7.12
+Is mandatory: false
+Website: http://curl.haxx.se/
+License: MIT/X derivate license
+Copyright: 1996 - 2011, Daniel Stenberg, <daniel@xxxxxxx>.
+External notice:
+
+ All rights reserved.
+
+ Permission to use, copy, modify, and distribute this software for any purpose
+ with or without fee is hereby granted, provided that the above copyright
+ notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+ OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name of a copyright holder shall not
+ be used in advertising or otherwise to promote the sale, use or other dealings
+ in this Software without prior written authorization of the copyright holder.
+
+----------------------------------------------------
+
+Name: ICONV
+Preferred version: above 1.12
+Is mandatory: true
+Website: http://www.gnu.org/software/libiconv/
+License: LGPL
+Copyright: 1998, 2010 Free Software Foundation, Inc.
+External notice:
+
+----------------------------------------------------
+
+Name: ZLIB
+Preferred version: 1.2.5
+Is mandatory: true
+Website: http://www.zlib.net/
+Copyright: 1995-2004 Jean-loup Gailly and Mark Adler
+External notice:
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly jloup@xxxxxxxx
+ Mark Adler madler@xxxxxxxxxxxxxxxxxx
+
+----------------------------------------------------
+
+Name: XERCES
+Preferred version: 2.8.0 or higher
+Is mandatory: true
+Website: http://xerces.apache.org/xerces-c/
+License: Apache 2
+Copyright: Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.
+External notice:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+----------------------------------------------------
+
+Name: BOOST (boost_filesystem)
+Preferred version: 1.32 or higher
+Is mandatory: false
+Website: http://www.boost.org/
+License: Boost Software License v1.0
+Copyright:
+ Beman Dawes, David Abrahams, 1998-2005.
+ Rene Rivera 2004-2007
+
+External notice:
+
+ Permission is hereby granted, free of charge, to any person or organization
+ obtaining a copy of the software and accompanying documentation covered by
+ this license (the "Software") to use, reproduce, display, distribute,
+ execute, and transmit the Software, and to prepare derivative works of the
+ Software, and to permit third-parties to whom the Software is furnished to
+ do so, all subject to the following:
+
+ The copyright notices in the Software and this entire statement, including
+ the above license grant, this restriction and the following disclaimer,
+ must be included in all copies of the Software, in whole or in part, and
+ all derivative works of the Software, unless such copies or derivative
+ works are solely in the form of machine-executable object code generated by
+ a source language processor.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+External applications used by this project:
+----------------------------------------------------
+
+Name: FLEX
+Preferred version: 2.5.33
+Is mandatory: false
+Website: http://flex.sourceforge.net/
+Copyright:
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The Flex Project.
+ 1990, 1997 The Regents of the University of California. All rights reserved.
+
+External notice:
+
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+ Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+----------------------------------------------------
+
+Name: BISON
+Preferred version: 2.4 or higher
+Is mandatory: false
+Website: http://www.gnu.org/software/bison/
+License: GPL
+Copyright: 1998, 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+External notice:
+
+----------------------------------------------------
+
+Name: DOXYGEN
+Preferred version: v1.7.4
+Is mandatory: false
+Website: www.doxygen.org
+License: GPL
+Copyright: 1997-2011 by Dimitri van Heesch
+External notice:
+
+ Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted.
+ No representations are made about the suitability of this software for any purpose.
+ It is provided "as is" without express or implied warranty.
+ See the GNU General Public License for more details.
+
+ Documents produced by doxygen are derivative works derived from the input used in their production; they are not affected by this license.
+
+----------------------------------------------------
+
+Name: CMAKE
+Preferred version: 2.8.4
+Is mandatory: true
+Website: http://www.cmake.org/
+License: Creative Commons Attribution-NoDerivs 3.0 Unported License
+Copyright: 2000-2009 Kitware, Inc., Insight Software Consortium. All rights reserved.
+External notice:
+
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+ Neither the names of Kitware, Inc., the Insight Software Consortium, nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------
+
+Name: SWIG
+Preferred version: 2.0.4 or above
+Is mandatory: false
+Website: http://www.swig.org/
+License: GPL
+Copyright:
+ 1995-2011 The SWIG Developers
+ 2005-2006 Arizona Board of Regents (University of Arizona).
+ 1998-2005 University of Chicago.
+ 1995-1998 The University of Utah and the Regents of the University of California
+
+External notice:
+
+ SWIG is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version. See the LICENSE-GPL file for
+ the full terms of the GNU General Public license version 3.
+
+ Portions of SWIG are also licensed under the terms of the licenses
+ in the file LICENSE-UNIVERSITIES. You must observe the terms of
+ these licenses, as well as the terms of the GNU General Public License,
+ when you distribute SWIG.
+
+ The SWIG library and examples, under the Lib and Examples top level
+ directories, are distributed under the following terms:
+
+ You may copy, modify, distribute, and make derivative works based on
+ this software, in source code or object code form, without
+ restriction. If you distribute the software to others, you may do
+ so according to the terms of your choice. This software is offered as
+ is, without warranty of any kind.
+
+ See the COPYRIGHT file for a list of contributors to SWIG and their
+ copyright notices.
+
\ No newline at end of file
=== added file 'NOTICE.xml'
--- NOTICE.xml 1970-01-01 00:00:00 +0000
+++ NOTICE.xml 2013-08-27 22:37:07 +0000
@@ -0,0 +1,686 @@
+<?xml version="1.0" encoding="utf-8"?>
+<notice xmlns="http://www.zorba-xquery.com/notice">
+ <master-license>
+ <license>Apache 2</license>
+ <text>
+ Copyright 2006-2011 The FLWOR Foundation
+
+ See LICENSE.txt for license information.
+
+ ------------------------
+ This product includes software developed at
+ The FLWOR Foundation (http://www.flworfound.org/).
+
+ ------------------------
+ Portions of this software were developed at the Systems
+ Group of the ETH Zurich, Switzerland.
+ </text>
+ </master-license>
+ <foreign-files>
+ <file>src/zorbatypes/m_apm.h</file>
+ <file>src/zorbatypes/mapm/</file>
+ <copyright>1999-2007 Michael C. Ring</copyright>
+ <website>http://www.tc.umn.edu/~ringx004/mapm-main.html</website>
+ <foreign-notice>
+ This software is Freeware.
+
+ Permission to use, copy, and distribute this software and its
+ documentation for any purpose with or without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and
+ that both that copyright notice and this permission notice appear
+ in supporting documentation.
+
+ Permission to modify the software is granted. Permission to distribute
+ the modified code is granted. Modifications are to be distributed by
+ using the file 'license.txt' as a template to modify the file header.
+ 'license.txt' is available in the official MAPM distribution.
+
+ To distribute modified source code, insert the file 'license.txt'
+ at the top of all modified source code files and edit accordingly.
+
+ This software is provided "as is" without express or implied warranty.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>src/zorbamisc/config/stdint.h</file>
+ <copyright>2006 Alexander Chemeris</copyright>
+ <foreign-notice>
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. The name of the author may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>src/zorbautils/stemmer/</file>
+ <copyright>2001 Dr. Martin Porter</copyright>
+ <foreign-notice>
+ All the software given out on this Snowball site is covered by the BSD
+ License (see http://www.opensource.org/licenses/bsd-license.html), with
+ Copyright (c) 2001, Dr Martin Porter, and (for the Java developments)
+ Copyright (c) 2002, Richard Boulton.
+
+ Essentially, all this means is that you can do what you like with the code,
+ except claim another Copyright for it, or claim that it is issued under a
+ different license. The software is also issued without warranties, which
+ means that if anyone suffers through its use, they cannot come back and sue
+ you. You also have to alert anyone to whom you give the Snowball software to
+ the fact that it is covered by the BSD license.
+
+ We have not bothered to insert the licensing arrangement into the text of
+ the Snowball software.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>src/util/less.h</file>
+ <copyright>1998 Paul J. Lucas</copyright>
+ <foreign-notice>
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ o Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ o The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file is-modified="true">src/util/auto_vector.h</file>
+ <copyright>2003 Reliable Software</copyright>
+ <foreign-notice>
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ o Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ o The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>cmake_modules/FindBoost.cmake</file>
+ <copyright>
+ 2006-2008 Andreas Schneider <mail@xxxxxxxxxxxx>
+ 2007 Wengo
+ 2007 Mike Jackson
+ 2008 Andreas Pakulat <apaku@xxxxxx>
+ </copyright>
+ <foreign-notice>
+ Redistribution AND use is allowed according to the terms of the New BSD license.
+ For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>cmake_modules/FindJNI.cmake</file>
+ <file>cmake_modules/FindPythonLibs.cmake</file>
+ <file>cmake_modules/FindSWIG.cmake</file>
+ <copyright>2001-2009 Kitware, Inc.</copyright>
+ <foreign-notice>
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the names of Kitware, Inc., the Insight Software Consortium,
+ nor the names of their contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ ------------------------------------------------------------------------------
+
+ The above copyright and license notice applies to distributions of
+ CMake in source and binary form. Some source files contain additional
+ notices of original copyright by their contributors; see each source
+ for details. Third-party software packages supplied with CMake under
+ compatible licenses provide their own copyright notices documented in
+ corresponding subdirectories.
+
+ ------------------------------------------------------------------------------
+
+ CMake was initially developed by Kitware with the following sponsorship:
+
+ * National Library of Medicine at the National Institutes of Health
+ as part of the Insight Segmentation and Registration Toolkit (ITK).
+
+ * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
+ Visualization Initiative.
+
+ * National Alliance for Medical Image Computing (NAMIC) is funded by the
+ National Institutes of Health through the NIH Roadmap for Medical Research,
+ Grant U54 EB005149.
+
+ * Kitware, Inc.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>/xml.xsd</file>
+ <copyright>2001 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)</copyright>
+ <foreign-notice>
+ All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+ W3C Software Notice and License
+
+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+ License
+
+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+ Disclaimers
+
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>schemas/xslt-xquery-serialization.xsd</file>
+ <copyright>2010 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)</copyright>
+ <foreign-notice>
+ All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+ W3C Software Notice and License
+
+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+ License
+
+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+ Disclaimers
+
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>modules/w3c/xpath-functions.xsd</file>
+ <copyright>2005 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)</copyright>
+ <foreign-notice>
+ All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+ W3C Software Notice and License
+
+ This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+ License
+
+ By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+ Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+ •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+ •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+ •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+ Disclaimers
+
+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+ The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>include/xqc.h</file>
+ <copyright>2008, Matthias Brantner, John Snelson</copyright>
+ <foreign-notice>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the developers nor the names of contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>modules/functx/functx.xq</file>
+ <copyright>2007 Datypic</copyright>
+ <foreign-notice>
+ : 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>src/compiler/parser/FlexLexer.h</file>
+ <copyright>1993 The Regents of the University of California</copyright>
+ <foreign-notice>
+ // All rights reserved.
+ //
+ // This code is derived from software contributed to Berkeley by
+ // Kent Williams and Tom Epperly.
+ //
+ // Redistribution and use in source and binary forms, with or without
+ // modification, are permitted provided that the following conditions
+ // are met:
+
+ // 1. Redistributions of source code must retain the above copyright
+ // notice, this list of conditions and the following disclaimer.
+ // 2. Redistributions in binary form must reproduce the above copyright
+ // notice, this list of conditions and the following disclaimer in the
+ // documentation and/or other materials provided with the distribution.
+
+ // Neither the name of the University nor the names of its contributors
+ // may be used to endorse or promote products derived from this software
+ // without specific prior written permission.
+
+ // THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ // IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ // PURPOSE.
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>src/diagnostics/StackWalker.cpp</file>
+ <file>src/diagnostics/StackWalker.h</file>
+ <copyright>2005 Jochen Kalmbach </copyright>
+ <license>BSD</license>
+ <foreign-notice>
+ Under BSD License: http://www.opensource.org/licenses/bsd-license.php
+ </foreign-notice>
+ </foreign-files>
+ <foreign-files>
+ <file>src/util/singleton.h</file>
+ <file>src/util/threads.h</file>
+ <copyright>2001 Andrei Alexandrescu</copyright>
+ <foreign-notice>
+ This code accompanies the book:
+ Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
+ Patterns Applied". Copyright (c) 2001. Addison-Wesley.
+ Permission to use, copy, modify, distribute and sell this software for any
+ purpose is hereby granted without fee, provided that the above copyright
+ notice appear in all copies and that both that copyright notice and this
+ permission notice appear in supporting documentation.
+ The author or Addison-Wesley Longman make no representations about the
+ suitability of this software for any purpose. It is provided "as is"
+ without express or implied warranty.
+ </foreign-notice>
+ </foreign-files>
+
+ <external-lib mandatory="true">
+ <name>LIBXML2</name>
+ <version>2.2.16 or higher</version>
+ <website>http://xmlsoft.org/</website>
+ <license>MIT</license>
+ <copyright>1998-2002 Daniel Veillard. All Rights Reserved.</copyright>
+ <foreign-notice>
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name of Daniel Veillard shall not
+ be used in advertising or otherwise to promote the sale, use or other deal-
+ ings in this Software without prior written authorization from him.
+ </foreign-notice>
+ </external-lib>
+
+ <external-lib mandatory="false">
+ <name>LIBXSLT</name>
+ <version>1.1.26</version>
+ <website>http://xmlsoft.org/XSLT/</website>
+ <license>MIT</license>
+ <copyright>2001-2002 Daniel Veillard. All Rights Reserved.</copyright>
+ <foreign-notice>
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+ Except as contained in this notice, the name of Daniel Veillard shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from him.
+
+ </foreign-notice>
+ </external-lib>
+
+ <external-lib mandatory="true">
+ <name>ICU4C</name>
+ <version>3.6 or higher</version>
+ <license>ICU License</license>
+ <website>http://www.icu-project.org/</website>
+ <copyright>1995-2011 International Business Machines Corporation and others </copyright>
+ <foreign-notice>
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+ Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
+ </foreign-notice>
+ </external-lib>
+
+ <external-lib mandatory="false">
+ <name>CURL</name>
+ <version>above 7.12</version>
+ <website>http://curl.haxx.se/</website>
+ <license>MIT/X derivate license</license>
+ <copyright>1996 - 2011, Daniel Stenberg, <daniel@xxxxxxx>.</copyright>
+ <foreign-notice>
+ All rights reserved.
+
+ Permission to use, copy, modify, and distribute this software for any purpose
+ with or without fee is hereby granted, provided that the above copyright
+ notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+ OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name of a copyright holder shall not
+ be used in advertising or otherwise to promote the sale, use or other dealings
+ in this Software without prior written authorization of the copyright holder.
+ </foreign-notice>
+ </external-lib>
+
+ <external-lib mandatory="true">
+ <name>ICONV</name>
+ <version>above 1.12</version>
+ <website>http://www.gnu.org/software/libiconv/</website>
+ <license>LGPL</license>
+ <copyright>1998, 2010 Free Software Foundation, Inc.</copyright>
+ </external-lib>
+
+ <external-lib mandatory="true">
+ <name>ZLIB</name>
+ <version>1.2.5</version>
+ <website>http://www.zlib.net/</website>
+ <copyright>1995-2004 Jean-loup Gailly and Mark Adler</copyright>
+ <foreign-notice>
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly jloup@xxxxxxxx
+ Mark Adler madler@xxxxxxxxxxxxxxxxxx
+ </foreign-notice>
+ </external-lib>
+
+ <external-lib mandatory="true">
+ <name>XERCES</name>
+ <version>2.8.0 or higher</version>
+ <website>http://xerces.apache.org/xerces-c/</website>
+ <license>Apache 2</license>
+ <copyright>Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.</copyright>
+ <foreign-notice>
+ http://www.apache.org/licenses/LICENSE-2.0
+ </foreign-notice>
+ </external-lib>
+
+ <external-lib mandatory="false">
+ <name>BOOST (boost_filesystem)</name>
+ <version>1.32 or higher</version>
+ <website>http://www.boost.org/</website>
+ <license>Boost Software License v1.0</license>
+ <copyright>
+ Beman Dawes, David Abrahams, 1998-2005.
+ Rene Rivera 2004-2007
+ </copyright>
+ <foreign-notice>
+ Permission is hereby granted, free of charge, to any person or organization
+ obtaining a copy of the software and accompanying documentation covered by
+ this license (the "Software") to use, reproduce, display, distribute,
+ execute, and transmit the Software, and to prepare derivative works of the
+ Software, and to permit third-parties to whom the Software is furnished to
+ do so, all subject to the following:
+
+ The copyright notices in the Software and this entire statement, including
+ the above license grant, this restriction and the following disclaimer,
+ must be included in all copies of the Software, in whole or in part, and
+ all derivative works of the Software, unless such copies or derivative
+ works are solely in the form of machine-executable object code generated by
+ a source language processor.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </foreign-notice>
+ </external-lib>
+
+ <external-app mandatory="false">
+ <name>FLEX</name>
+ <version>2.5.33</version>
+ <website>http://flex.sourceforge.net/</website>
+ <copyright>
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The Flex Project.
+ 1990, 1997 The Regents of the University of California. All rights reserved.
+ </copyright>
+ <foreign-notice>
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+ Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ </foreign-notice>
+ </external-app>
+
+ <external-app mandatory="false">
+ <name>BISON</name>
+ <version>2.4 or higher</version>
+ <website>http://www.gnu.org/software/bison/</website>
+ <license>GPL</license>
+ <copyright>1998, 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.</copyright>
+ </external-app>
+
+ <external-app mandatory="false">
+ <name>DOXYGEN</name>
+ <version>v1.7.4 </version>
+ <website>www.doxygen.org</website>
+ <license>GPL</license>
+ <copyright>1997-2011 by Dimitri van Heesch</copyright>
+ <foreign-notice>
+ Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted.
+ No representations are made about the suitability of this software for any purpose.
+ It is provided "as is" without express or implied warranty.
+ See the GNU General Public License for more details.
+
+ Documents produced by doxygen are derivative works derived from the input used in their production; they are not affected by this license.
+ </foreign-notice>
+ </external-app>
+
+ <external-app mandatory="true">
+ <name>CMAKE</name>
+ <version>2.8.4</version>
+ <website>http://www.cmake.org/</website>
+ <license>Creative Commons Attribution-NoDerivs 3.0 Unported License</license>
+ <copyright>2000-2009 Kitware, Inc., Insight Software Consortium. All rights reserved.</copyright>
+ <foreign-notice>
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+ Neither the names of Kitware, Inc., the Insight Software Consortium, nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ </foreign-notice>
+ </external-app>
+
+ <external-app mandatory="false">
+ <name>SWIG</name>
+ <version>2.0.4 or above</version>
+ <website>http://www.swig.org/</website>
+ <license>GPL</license>
+ <copyright>
+ 1995-2011 The SWIG Developers
+ 2005-2006 Arizona Board of Regents (University of Arizona).
+ 1998-2005 University of Chicago.
+ 1995-1998 The University of Utah and the Regents of the University of California
+ </copyright>
+ <foreign-notice>
+ SWIG is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version. See the LICENSE-GPL file for
+ the full terms of the GNU General Public license version 3.
+
+ Portions of SWIG are also licensed under the terms of the licenses
+ in the file LICENSE-UNIVERSITIES. You must observe the terms of
+ these licenses, as well as the terms of the GNU General Public License,
+ when you distribute SWIG.
+
+ The SWIG library and examples, under the Lib and Examples top level
+ directories, are distributed under the following terms:
+
+ You may copy, modify, distribute, and make derivative works based on
+ this software, in source code or object code form, without
+ restriction. If you distribute the software to others, you may do
+ so according to the terms of your choice. This software is offered as
+ is, without warranty of any kind.
+
+ See the COPYRIGHT file for a list of contributors to SWIG and their
+ copyright notices.
+ </foreign-notice>
+ </external-app>
+</notice>
=== added file 'README.txt'
--- README.txt 1970-01-01 00:00:00 +0000
+++ README.txt 2013-08-27 22:37:07 +0000
@@ -0,0 +1,48 @@
+ --------------------------------------------------------------
+ Zorba - The XQuery Processor developed by the FLWOR Foundation
+ --------------------------------------------------------------
+
+ The Latest Version
+ ------------------
+
+ The latest version can be found at http://www.zorba-xquery.org/.
+
+ Documentation
+ -------------
+
+ The documentation is included in the doc directory, as well as
+ on the website of the project at http://www.zorba-xquery.org/html/documentation
+
+ Build & Installation
+ --------------------
+
+ Please see the documentation on the web site or in the doc directory
+ of the package.
+
+ Bugs and errors
+ ---------------
+
+ Bug or error reports should be sent to
+ https://bugs.launchpad.net/zorba.
+
+
+ Licensing
+ ---------
+
+ Please see the file called LICENSE.txt.
+
+
+ Contacts
+ --------
+
+ o If you want to be informed about new code releases, bug fixes
+ and general news and information about the Zorba XQuery Processor
+ subscribe to the Zorba Users mailing list as described under
+ <zorba-users@xxxxxxxxxxxxxxxxxxxxx>
+
+ o If you have a concrete bug report for Zorba please go to the
+ Zorba's Bug Database and submit your report:
+ https://bugs.launchpad.net/zorba.
+
+ o If you want to participate in actively developing Zorba or
+ support Zorba, please write a mail to: zorba-dev@xxxxxxxxxxxxxxxx
=== added file 'WIN32.cpack'
--- WIN32.cpack 1970-01-01 00:00:00 +0000
+++ WIN32.cpack 2013-08-27 22:37:07 +0000
@@ -0,0 +1,16 @@
+# 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.
+#
+
+INCLUDE(InstallRequiredSystemLibraries)
=== added directory 'bin'
=== added file 'bin/CMakeLists.txt'
--- bin/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ bin/CMakeLists.txt 2013-08-27 22:37:07 +0000
@@ -0,0 +1,139 @@
+# 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.
+
+INCLUDE_DIRECTORIES(AFTER ${CMAKE_SOURCE_DIR}/src/)
+INCLUDE_DIRECTORIES(AFTER ${CMAKE_CURRENT_SOURCE_DIR})
+
+INCLUDE("${CMAKE_SOURCE_DIR}/cmake_modules/ZorbaGenerateExe.cmake")
+
+IF (ZORBA_WITH_DEBUGGER)
+ IF (NOT WIN32)
+ FIND_PACKAGE (Libedit)
+ IF (LIBEDIT_FOUND)
+ INCLUDE_DIRECTORIES (${LIBEDIT_INCLUDE_DIRS})
+ SET (LIBEDIT_LIBS ${LIBEDIT_LIBRARIES})
+ SET (ZORBA_HAVE_LIBEDIT_H ${LIBEDIT_FOUND})
+ ENDIF (LIBEDIT_FOUND)
+ ENDIF (NOT WIN32)
+
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/debugger/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/debugger/config.h)
+ MESSAGE(STATUS "configured ${CMAKE_CURRENT_SOURCE_DIR}/debugger/config.h.cmake --> ${CMAKE_CURRENT_BINARY_DIR}/debugger/config.h")
+ INCLUDE_DIRECTORIES (BEFORE ${CMAKE_CURRENT_BINARY_DIR}/debugger)
+
+ SET (DEBUG_CLIENT_SRCS
+ debugger/main.cpp
+ debugger/xqdb_client.cpp
+ debugger/process_listener.cpp
+ debugger/command_prompt.cpp
+ debugger/command_line_handler.cpp
+ debugger/event_handler.cpp
+ )
+
+ ZORBA_GENERATE_EXE ("xqdb" "${DEBUG_CLIENT_SRCS}" "${LIBEDIT_LIBS}" "xqdb" "bin")
+ENDIF (ZORBA_WITH_DEBUGGER)
+
+SET(SRCS
+ zorbacmd.cpp
+ zorbacmdproperties.cpp
+ util.cpp
+ path_util.cpp
+)
+
+ZORBA_GENERATE_EXE("zorbacmd" "${SRCS}" "" "zorba" "bin")
+
+IF(UNIX)
+ ADD_CUSTOM_TARGET(zorbacmd_man help2man -N -s1 -n Zorba -S "FLWOR Foundation" ./zorba > "${PROJECT_BINARY_DIR}/doc/zorba.1")
+ ADD_DEPENDENCIES(zorbacmd_man zorbacmd)
+ENDIF(UNIX)
+
+# test the basic features of the command line tool
+ZORBA_ADD_TEST(bin/zorba1 zorbacmd --omit-xml-declaration -q "1+1")
+ZORBA_SET_TEST_PROPERTY(bin/zorba1 PASS_REGULAR_EXPRESSION "2")
+
+ZORBA_ADD_TEST(bin/zorba2 zorbacmd --serialize-html -q "1+1")
+ZORBA_SET_TEST_PROPERTY(bin/zorba2 PASS_REGULAR_EXPRESSION "2")
+
+ZORBA_ADD_TEST(bin/zorba3 zorbacmd -m 0 -q "1+1")
+ZORBA_SET_TEST_PROPERTY(bin/zorba3 PASS_REGULAR_EXPRESSION "")
+
+ZORBA_ADD_TEST(bin/zorba4 zorbacmd --context-item=${CMAKE_CURRENT_SOURCE_DIR}/test.xml -m 3 -q "./test/child[1]")
+ZORBA_SET_TEST_PROPERTY(bin/zorba4 PASS_REGULAR_EXPRESSION "(.*<child>child1</child>)*")
+
+ZORBA_ADD_TEST(bin/zorba5 zorbacmd -q -f blub.xq)
+ZORBA_SET_TEST_PROPERTY(bin/zorba5 PASS_REGULAR_EXPRESSION ".*Extra arguments found on command line.*")
+
+# test the compile-only option of the command line tool which is used for semantic checking in eclipse
+ZORBA_ADD_TEST(bin/zorba_compilechk1 zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/test/mymod.xq" -f -l)
+ZORBA_SET_TEST_PROPERTY(bin/zorba_compilechk1 PASS_REGULAR_EXPRESSION ".*mymod.xq>:22,8:.*:XPST0008.*")
+
+ZORBA_ADD_TEST(bin/zorba_compilechk2 zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/test/mymod.xq" -f -l -x)
+ZORBA_SET_TEST_PROPERTY(bin/zorba_compilechk2 PASS_REGULAR_EXPRESSION ".*XPST0008.*mymod.xq.*lineStart=['\"]22['\"] columnStart=['\"]8['\"] lineEnd=['\"]22['\"] columnEnd=['\"]10['\"].*")
+
+# test compile checking to work with library modules that have an invalid target namespace uri
+# test for bug #2934414
+ZORBA_ADD_TEST(bin/zorba_compilechk3 zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/test/mymod2.xq" -f -l -x)
+ZORBA_SET_TEST_PROPERTY(bin/zorba_compilechk3 PASS_REGULAR_EXPRESSION ".*XQST0046.*mymod2.xq.*lineStart=['\"]17['\"] columnStart=['\"]1['\"] lineEnd=['\"]17['\"] columnEnd=['\"]26['\"].*")
+
+# test the --option option to set an option in the static context
+ZORBA_ADD_TEST(bin/zorba_option zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/test/option.xq" -f --option "{http://www.zorba-xquery.com}option=value")
+ZORBA_SET_TEST_PROPERTY(bin/zorba_option PASS_REGULAR_EXPRESSION "value")
+
+# test the --uri-path, --lib-path, and --module-path args.
+# Use the versioning tests as they utilize test modules already.
+SET (_testdir
+ "${CMAKE_CURRENT_SOURCE_DIR}/../test/rbkt/Queries/zorba")
+SET (_uridir "${CMAKE_BINARY_DIR}/TEST_URI_PATH")
+SET (_libdir "${CMAKE_BINARY_DIR}/TEST_LIB_PATH")
+ZORBA_ADD_TEST(bin/zorba_uri_path_1 zorbacmd
+ -f -q "${_testdir}/versioning/import1.xq"
+ --uri-path "${_uridir}")
+ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_1
+ PASS_REGULAR_EXPRESSION "hello, v2")
+
+ZORBA_ADD_TEST(bin/zorba_uri_path_2 zorbacmd
+ -f -q "${_testdir}/versioning/external1.xq"
+ --uri-path "${_uridir}")
+ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_2
+ PASS_REGULAR_EXPRESSION "ZXQP0008")
+
+ZORBA_ADD_TEST(bin/zorba_uri_path_3 zorbacmd
+ -f -q "${_testdir}/versioning/external1.xq"
+ --uri-path "${_uridir}" --lib-path "${_libdir}")
+ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_3
+ PASS_REGULAR_EXPRESSION "hello, v2")
+
+# test the --disable-http-resolution flag, using the corresponding test query
+# from rbkt/zorba/uris/disable-http and a timeout.
+ZORBA_ADD_TEST(bin/zorba_disable_http_download zorbacmd
+ -f -q "${_testdir}/uris/disable-http.xq" --disable-http-resolution)
+ZORBA_SET_TEST_PROPERTY(bin/zorba_disable_http_download
+ PASS_REGULAR_EXPRESSION "XQST0059")
+ZORBA_SET_TEST_PROPERTY(bin/zorba_disable_http_download TIMEOUT 5)
+
+IF(WIN32)
+ SET(PATH_SEP ";")
+ELSE(WIN32)
+ SET(PATH_SEP ":")
+ENDIF(WIN32)
+ZORBA_ADD_TEST(bin/zorba_module_path_1 zorbacmd
+ -f -q "${_testdir}/versioning/external1.xq"
+ --module-path "${_libdir}${PATH_SEP}${_uridir}")
+ZORBA_SET_TEST_PROPERTY(bin/zorba_module_path_1
+ PASS_REGULAR_EXPRESSION "hello, v2")
+
+# test compilation of the perf script
+ZORBA_ADD_TEST(bin/zorba_compilechk4 zorbacmd
+ -q "${CMAKE_CURRENT_SOURCE_DIR}/../test/zperf/src/start.xq" -f --compile-only)
+ZORBA_SET_TEST_PROPERTY(bin/zorba_compilechk4
+ PASS_REGULAR_EXPRESSION "[]|[XQST0059]")
=== added directory 'bin/debugger'
=== added file 'bin/debugger/command.h'
--- bin/debugger/command.h 1970-01-01 00:00:00 +0000
+++ bin/debugger/command.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,293 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_COMMAND_H
+#define ZORBA_DEBUGGER_COMMAND_H
+
+#include <string>
+#include <vector>
+#include <iostream>
+#include <set>
+#include <map>
+#include <sstream>
+#include <memory>
+#include <typeinfo>
+
+#include <zorba/config.h>
+
+#include "command_arg.h"
+#include "tuple.h"
+
+
+namespace zorba { namespace debugger {
+
+ class DebugClientParseException : public std::exception {
+ };
+
+ template<typename Func, typename Tuple, int CommandIdx>
+ class CommandInstance
+ {
+ public:
+ CommandInstance(Func& aFunction, Tuple aTuple)
+ : theFunction(aFunction), theTuple(aTuple), allSet(false) {}
+ public:
+ virtual bool parseArguments(const std::vector<std::string>& args,
+ const std::map<std::string,
+ CommandArg<Tuple>* >& aCommandArgs);
+ virtual void execute();
+ private:
+ Func& theFunction;
+ Tuple theTuple;
+ bool allSet;
+ bool parseError;
+ };
+
+ class UntypedCommand {
+ public:
+ virtual ~UntypedCommand() {}
+ virtual std::string getName() const = 0;
+ virtual std::set<std::string> getAliases() const = 0;
+ virtual std::string getDescription() const = 0;
+ virtual void printHelp() const = 0;
+ virtual bool execute(const std::vector<std::string>& args) = 0;
+ };
+
+ template<typename Func, typename Tuple, int CommandIdx>
+ class Command : public UntypedCommand {
+ public:
+ Command(const std::string& aName, Func& aFunction, const std::string& aDescription)
+ : theName(aName), theFunction(aFunction), theDescription(aDescription)
+ {}
+
+ Command(const std::string& aName, const std::set<std::string> aAliases, Func& aFunction, const std::string& aDescription)
+ : theName(aName), theAliases(aAliases), theFunction(aFunction), theDescription(aDescription)
+ {}
+
+ ~Command();
+
+ public:
+
+ void
+ addArgument(
+ unsigned aId,
+ const std::string& aFlags,
+ CommandArgType<Tuple>* aType,
+ const std::string& aDescription = "",
+ bool isRequired = false);
+
+ static void
+ splitNames(
+ const std::string& names,
+ std::set<std::string>& set);
+
+ virtual std::string
+ getName() const
+ {
+ return theName;
+ }
+
+ virtual std::set<std::string> getAliases() const
+ {
+ return theAliases;
+ }
+
+ virtual std::string
+ getDescription() const
+ {
+ return theDescription;
+ }
+
+ virtual void
+ printHelp() const;
+
+ virtual bool execute(const std::vector<std::string>& args)
+ {
+ CommandInstance<Func, Tuple, CommandIdx> instance(theFunction, theTuple);
+ if (instance.parseArguments(args, theArgs)) {
+ instance.execute();
+ return true;
+ }
+ return false;
+ }
+ private:
+ std::string theName;
+ std::set<std::string> theAliases;
+ Func& theFunction;
+ Tuple theTuple;
+ std::string theDescription;
+ std::map<std::string, CommandArg<Tuple>*> theArgs;
+ };
+
+/*****************************************************************************/
+/*****************************************************************************/
+
+template<typename Func, typename Tuple, int CommandIdx>
+Command<Func, Tuple, CommandIdx>::~Command()
+{
+ typedef std::map<std::string, CommandArg<Tuple>*> ArgType;
+ for (typename ArgType::iterator i = theArgs.begin(); i != theArgs.end(); ++i) {
+ delete i->second;
+ }
+}
+
+template<typename Func, typename Tuple, int CommandIdx>
+void
+Command<Func, Tuple, CommandIdx>::printHelp() const
+{
+ std::cout << "Purpose: " << getDescription() << std::endl;
+
+ typename std::map<std::string, CommandArg<Tuple>*>::const_iterator lIter = theArgs.begin();
+ if (lIter == theArgs.end()) {
+ std::cout << "This command has no arguments." << std::endl;
+ std::cout << std::endl;
+ return;
+ }
+
+ std::cout << "Arguments:" << std::endl << std::endl;
+ for (; lIter != theArgs.end(); ++lIter) {
+ std::cout << " " << lIter->first << "\t" << lIter->second->getDescription() << std::endl;
+ }
+ std::cout << std::endl;
+}
+
+template<typename Func, typename Tuple, int CommandIdx>
+void
+Command<Func, Tuple, CommandIdx>::splitNames(const std::string& aNames, std::set<std::string>& aSet)
+{
+ std::string::size_type before = 0;
+ std::string::size_type pos = aNames.find(" ", 0);
+ while (pos != aNames.npos) {
+ std::string lName = aNames.substr(before, pos);
+ if (lName != "") {
+ aSet.insert(lName);
+ }
+ before = pos + 1;
+ pos = aNames.find(" ", before);
+ }
+ std::string lName = aNames.substr(before);
+ if (lName != "") {
+ aSet.insert(lName);
+ }
+}
+
+template<typename Func, typename Tuple, int CommandIdx>
+void
+Command<Func, Tuple, CommandIdx>::addArgument(
+ unsigned aId,
+ const std::string& aFlags,
+ CommandArgType<Tuple>* aType,
+ const std::string& aDescription,
+ bool isRequired)
+{
+ std::set<std::string> lNames;
+ splitNames(aFlags, lNames);
+
+ for (std::set<std::string>::iterator i = lNames.begin(); i != lNames.end(); ++i) {
+ std::string toAdd = (i->size() == 1) ? "-" + *i : "--" + *i;
+ CommandArg<Tuple>* lArg = new CommandArg<Tuple>(aId, aType, lNames, aDescription, isRequired);
+ theArgs.insert(std::make_pair(toAdd, lArg));
+ }
+}
+
+/*****************************************************************************/
+
+ template<typename Tuple, typename T, int Idx>
+ CommandArgType<Tuple>* createArgType(Tuple t)
+ {
+ return new TypedCommandArgType<T, Idx, Tuple>(false);
+ }
+
+ template<typename Tuple, typename T, int Idx>
+ CommandArgType<Tuple>* createArgType(Tuple t,
+ const T& aDefault)
+ {
+ return new TypedCommandArgType<T, Idx, Tuple>(aDefault, false);
+ }
+
+ template<int CommandIdx, typename Tuple, typename Func>
+ Command<Func, Tuple, CommandIdx>* createCommand(Tuple t,
+ const std::string& aName,
+ Func& aFunction,
+ const std::string& aDescription)
+ {
+ return new Command<Func, Tuple, CommandIdx>(aName, aFunction, aDescription);
+ }
+
+ template<int CommandIdx, typename Tuple, typename Func>
+ Command<Func, Tuple, CommandIdx>* createCommand(Tuple t,
+ const std::string& aName,
+ const std::set<std::string>& aAliases,
+ Func& aFunction,
+ const std::string& aDescription)
+ {
+ return new Command<Func, Tuple, CommandIdx>(aName, aAliases, aFunction, aDescription);
+ }
+
+ template<typename Func, typename Tuple, int CommandIdx>
+ bool CommandInstance<Func, Tuple, CommandIdx>::
+ parseArguments(const std::vector<std::string>& args,
+ const std::map<std::string, CommandArg<Tuple>* >& aCommandArgs)
+ {
+ typedef std::vector<std::string> ArgType;
+ typedef std::map<std::string, CommandArg<Tuple>* > CArgType;
+ ArgType::size_type size = args.size();
+ for (ArgType::size_type i = 1; i < size; ++i) {
+ typename CArgType::const_iterator pos = aCommandArgs.find(args[i]);
+ if (pos == aCommandArgs.end()) {
+ std::cerr << "Error: Unknown option " << args[i] << std::endl;
+ parseError = true;
+ return false;
+ }
+ const CommandArg<Tuple>& arg = *(pos->second);
+ std::auto_ptr<CommandArgInstance<Tuple> > instance;
+ if (arg.isVoid()) {
+ instance.reset(arg.parse("1"));
+ } else {
+ ++i;
+ if (i >= size) {
+ std::cerr << "Error: Missing value for argument " << args[i - 1] << std::endl;
+ parseError = true;
+ allSet = false;
+ return false;
+ }
+ instance.reset(arg.parse(args[i]));
+ }
+ if (instance.get()) {
+ instance->insertValue(theTuple);
+ }
+ }
+ bool allSet = true;
+ for (typename CArgType::const_iterator i = aCommandArgs.begin();
+ i != aCommandArgs.end(); ++i)
+ {
+ if (i->second->isRequired() && !i->second->isSet(theTuple)) {
+ std::cerr << "Error: Argument -" << i->second->getName() << " not set" << std::endl;
+ allSet = false;
+ }
+ }
+ return allSet;
+ }
+
+ template<typename Func, typename Tuple, int CommandIdx>
+ void CommandInstance<Func, Tuple, CommandIdx>::execute()
+ {
+ theFunction.template handle<CommandIdx>(this->theTuple);
+ }
+
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_COMMAND_H
=== added file 'bin/debugger/command_arg.h'
--- bin/debugger/command_arg.h 1970-01-01 00:00:00 +0000
+++ bin/debugger/command_arg.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,237 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_COMMAND_ARG_H
+#define ZORBA_DEBUGGER_COMMAND_ARG_H
+
+#include <string>
+#include <iostream>
+#include <set>
+#include <sstream>
+
+#include "tuple.h"
+
+
+namespace zorba { namespace debugger {
+
+template<typename Tuple>
+class CommandArg;
+
+template<typename Tuple>
+class CommandArgInstance {
+ public:
+ virtual int get_index() const = 0;
+ virtual const CommandArg<Tuple>* get_arg() const = 0;
+ virtual void insertValue(Tuple& t) = 0;
+ virtual bool isSet(Tuple& t) const = 0;
+};
+
+template<typename T, int Idx, typename Tuple>
+class TypedCommandArgInstance : public CommandArgInstance<Tuple>
+{
+ public:
+ TypedCommandArgInstance(T aValue, const CommandArg<Tuple>* aArg)
+ : theValue(aValue), theArg(aArg)
+ {
+ }
+
+ virtual int
+ get_index() const
+ {
+ return Idx;
+ }
+
+ virtual const CommandArg<Tuple>*
+ get_arg() const
+ {
+ return theArg;
+ }
+
+ virtual void
+ insertValue(Tuple& t)
+ {
+ ZORBA_TR1_NS::get<Idx>(t).first = true;
+ ZORBA_TR1_NS::get<Idx>(t).second = theValue;
+ }
+
+ virtual bool isSet(Tuple& t) const
+ {
+ return ZORBA_TR1_NS::get<Idx>(t).first;
+ }
+
+ private:
+
+ T theValue;
+ const CommandArg<Tuple>* theArg;
+};
+
+template<typename Tuple>
+class CommandArgType
+{
+ public:
+ virtual CommandArgInstance<Tuple>*
+ parse(
+ const std::string& str,
+ const CommandArg<Tuple>* arg) = 0;
+
+ virtual bool
+ isVoid() const = 0;
+
+ virtual bool
+ isSet(Tuple& t) const = 0;
+
+ virtual ~CommandArgType() {}
+};
+
+ template<typename T, int Idx, typename Tuple>
+ class TypedCommandArgType : public CommandArgType<Tuple> {
+ public:
+ typedef T Type;
+ public: // implementation
+ TypedCommandArgType(bool aIsVoid) : theIsVoid(aIsVoid) {}
+ TypedCommandArgType(const T& aValue,
+ bool aIsVoid)
+ : theDefault(aValue), theIsVoid(aIsVoid) {}
+ virtual CommandArgInstance<Tuple>* parse(const std::string& str,
+ const CommandArg<Tuple>* arg)
+ {
+ T aValue;
+
+ // special treatment for strings
+ // this is a double hack:
+ // - we check the type name if this starts with: class std::basic_string
+ // - we use void* in readEntireString to workaround the template type T
+ // which would otherwise complain during compilation if types and
+ // operators do not match
+ // TOSO: probably someone can find a more elegant solution
+ std::string lTypeName(typeid(T).name());
+ if (lTypeName.find("class std::basic_string") == 0) {
+ readEntireString(str, &aValue);
+ } else {
+ std::stringstream stream(str);
+ std::stringstream out;
+ stream >> aValue;
+ if (stream.fail()) {
+ std::cerr << "Error: Could not parse value \"" << str << "\" as type "
+ << typeid(T).name()
+ << std::endl;
+ return 0;
+ }
+ }
+
+ return new TypedCommandArgInstance<T, Idx, Tuple>(aValue, arg);
+ }
+ virtual bool isVoid() const { return theIsVoid; }
+ virtual bool isSet(Tuple& t) const
+ {
+ return ZORBA_TR1_NS::get<Idx>(t).first;
+ }
+ private:
+ void readEntireString(std::string aIn, void* aValue)
+ {
+ *((std::string*)aValue) = aIn;
+ }
+
+ TypedCommandArgType<T, Idx, Tuple>() {}
+ T theDefault;
+ bool theIsVoid;
+ };
+
+ template<typename Tuple>
+ class CommandArg {
+ public:
+ CommandArg(unsigned aId,
+ CommandArgType<Tuple>* aType,
+ const std::set<std::string>& aNames,
+ const std::string& aDescription,
+ bool aIsRequired)
+ : theId(aId),
+ theType(aType),
+ theNames(aNames),
+ theDescription(aDescription),
+ theIsRequired(aIsRequired)
+ {
+ }
+
+ ~CommandArg()
+ {
+ delete theType;
+ }
+
+ unsigned
+ get_id() const
+ {
+ return theId;
+ }
+
+ bool
+ canHandle(const std::string& arg) const
+ {
+ if (theNames.find(arg) != theNames.end()) {
+ return true;
+ }
+ return false;
+ }
+
+ CommandArgInstance<Tuple>*
+ parse(const std::string& str) const
+ {
+ return theType->parse(str, this);
+ }
+
+ bool
+ isVoid() const
+ {
+ return theType->isVoid();
+ }
+
+ bool
+ isRequired() const
+ {
+ return theIsRequired;
+ }
+
+ std::string
+ getName() const
+ {
+ return *(theNames.begin());
+ }
+
+ std::string
+ getDescription() const
+ {
+ return theDescription;
+ }
+
+ bool
+ isSet(Tuple& t) const
+ {
+ return theType->isSet(t);
+ }
+
+ private:
+
+ unsigned theId;
+ CommandArgType<Tuple>* theType;
+ std::set<std::string> theNames;
+ std::string theDescription;
+ bool theIsRequired;
+ };
+
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_COMMAND_ARG_H
=== added file 'bin/debugger/command_line_handler.cpp'
--- bin/debugger/command_line_handler.cpp 1970-01-01 00:00:00 +0000
+++ bin/debugger/command_line_handler.cpp 2013-08-27 22:37:07 +0000
@@ -0,0 +1,407 @@
+ /*
+ * 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.
+ */
+#include "command_line_handler.h"
+
+#ifndef WIN32
+# include <unistd.h>
+# define msleep(x) usleep(1000*x)
+#else
+# include <Windows.h>
+# define msleep Sleep
+#endif
+
+#include "command_prompt.h"
+
+
+namespace zorba { namespace debugger {
+
+ using namespace ::ZORBA_TR1_NS;
+
+CommandLineHandler::CommandLineHandler(
+ unsigned short port,
+ LockFreeConsumer<std::size_t>& aConsumer,
+ LockFreeConsumer<bool>& aContinueQueue,
+ EventHandler* aHandler,
+ CommandPrompt* aCommandPrompt)
+ : theConsumer(aConsumer),
+ theContinueQueue(aContinueQueue),
+ theClient(DebuggerClient::createDebuggerClient(aHandler, port, "localhost")),
+ theCommandLine(aCommandPrompt),
+ theQuit(false), theTerminated(true), theContinue(false), theWaitFor(0)
+ {
+ addCommands();
+ }
+
+CommandLineHandler::~CommandLineHandler()
+{
+}
+
+void
+CommandLineHandler::execute()
+{
+ theClient->accept();
+ std::set<std::size_t> lIdList;
+ do {
+ getNextId(lIdList);
+ while (lIdList.find(theWaitFor) == lIdList.end()) {
+ getNextId(lIdList);
+ msleep(20);
+ }
+ bool lCanQuit;
+ while (!theContinueQueue.consume(lCanQuit)) {
+ msleep(20);
+ }
+ if (lCanQuit) {
+ theTerminated = true;
+ }
+ theCommandLine->execute();
+ while (theContinue) {
+ theContinue = false;
+ theCommandLine->execute();
+ }
+ } while (!theQuit);
+}
+
+void
+CommandLineHandler::getNextId(std::set<std::size_t>& aIdList)
+{
+ std::size_t result;
+ if (theConsumer.consume(result)) {
+ aIdList.insert(result);
+ }
+}
+
+template<>
+void
+CommandLineHandler::handle<Status>(ZORBA_TR1_NS::tuple<> &t)
+{
+ theWaitFor = theClient->status();
+}
+
+template<>
+void
+CommandLineHandler::handle<Variables>(ZORBA_TR1_NS::tuple<> &t)
+{
+ theWaitFor = theClient->variables();
+}
+
+template<>
+void
+CommandLineHandler::handle<Quit>(ZORBA_TR1_NS::tuple<> &t)
+{
+ if (!theTerminated) {
+ bool answered = false;
+ while (!answered) {
+ std::cout << "Do you really want to stop debugging and exit? (y/n) ";
+ std::string lAnswer;
+ std::getline(std::cin, lAnswer);
+ if (lAnswer == "y" || lAnswer == "yes") {
+ answered = true;
+ } else if (lAnswer == "n" || lAnswer == "no") {
+ theContinue = true;
+ return;
+ }
+ }
+ }
+ theWaitFor = theClient->stop(true);
+ theClient->quit();
+ theQuit = true;
+}
+
+template<>
+void
+CommandLineHandler::handle<Run>(ZORBA_TR1_NS::tuple<> &t)
+{
+ theTerminated = false;
+ theWaitFor = theClient->run();
+}
+
+template<>
+void
+CommandLineHandler::handle<Stop>(ZORBA_TR1_NS::tuple<> &t)
+{
+ theWaitFor = theClient->stop(false);
+}
+
+template<>
+void
+CommandLineHandler::handle<BreakpointSet>(std::tr1::tuple<bstring, bstring, bint> &aTuple)
+{
+ DebuggerClient::BreakpointType lType = DebuggerClient::Line;
+ bool lEnabled = true;
+ if (get<0>(aTuple).first) {
+ if (get<0>(aTuple).second == "disabled") {
+ lEnabled = false;
+ }
+ }
+ theWaitFor = theClient->breakpoint_set(lType,
+ lEnabled,
+ get<1>(aTuple).second,
+ get<2>(aTuple).second);
+}
+
+template<>
+void
+CommandLineHandler::handle<BreakpointGet>(tuple<bint> &aTuple)
+{
+ theWaitFor = theClient->breakpoint_get(get<0>(aTuple).second);
+}
+
+template<>
+void
+CommandLineHandler::handle<BreakpointRemove>(tuple<bint> &aTuple)
+{
+ theWaitFor = theClient->breakpoint_remove(get<0>(aTuple).second);
+}
+
+template<>
+void
+CommandLineHandler::handle<BreakpointList>(tuple<> &aTuple)
+{
+ theWaitFor = theClient->breakpoint_list();
+}
+
+template<>
+void
+CommandLineHandler::handle<StackDepth>(tuple<> &aTuple)
+{
+ theWaitFor = theClient->stack_depth();
+}
+
+template<>
+void
+CommandLineHandler::handle<StackGet>(tuple<bint> &aTuple)
+{
+ if (get<0>(aTuple).first) {
+ theWaitFor = theClient->stack_get(get<0>(aTuple).second);
+ } else {
+ theWaitFor = theClient->stack_get();
+ }
+}
+
+template<>
+void
+CommandLineHandler::handle<ContextNames>(tuple<>& aTuple)
+{
+ theWaitFor = theClient->context_names();
+}
+
+template<>
+void CommandLineHandler::handle<ContextGet>(tuple<bint, bint> &aTuple)
+{
+ int lDepth = -1;
+ int lContext = -1;
+
+ if (get<0>(aTuple).first) {
+ lDepth = get<0>(aTuple).second;
+ }
+ if (get<1>(aTuple).first) {
+ lContext = get<1>(aTuple).second;
+ }
+ theWaitFor = theClient->context_get(lDepth, lContext);
+}
+
+template<>
+void CommandLineHandler::handle<Source>(tuple<bint, bint, bstring> &aTuple)
+{
+ theWaitFor = theClient->source(
+ get<2>(aTuple).second,
+ get<0>(aTuple).second,
+ get<1>(aTuple).second);
+}
+
+template<>
+void CommandLineHandler::handle<Eval>(tuple<bstring>& aTuple)
+{
+ theWaitFor = theClient->eval(get<0>(aTuple).second);
+}
+
+template<>
+void
+CommandLineHandler::handle<StepIn>(ZORBA_TR1_NS::tuple<> &t)
+{
+ theTerminated = false;
+ theWaitFor = theClient->step_into();
+}
+
+template<>
+void
+CommandLineHandler::handle<StepOut>(ZORBA_TR1_NS::tuple<> &t)
+{
+ theWaitFor = theClient->step_out();
+}
+
+template<>
+void
+CommandLineHandler::handle<StepOver>(ZORBA_TR1_NS::tuple<> &t)
+{
+ theTerminated = false;
+ theWaitFor = theClient->step_over();
+}
+
+void
+CommandLineHandler::addCommands()
+{
+ typedef tuple<> TUPLE;
+ typedef tuple<bint> TUPLE_INT;
+ typedef tuple<bstring> TUPLE_STR;
+ typedef tuple<bint, bint> TUPLE_INT_INT;
+ typedef tuple<bstring, bstring, bint> TUPLE_STR_STR_INT;
+ typedef tuple<bint, bint, bstring> TUPLE_INT_INT_STR;
+
+ // DBGP: status
+ *theCommandLine << createCommand<Status>(TUPLE(), "status", *this, "Gets the status of the server");
+
+ // ALIAS: variables (context_get -c -1)
+ {
+ std::set<std::string> lAliases;
+ lAliases.insert("vars");
+ *theCommandLine << createCommand<Variables>(TUPLE(), "variables", lAliases, *this, "Gets the variables visible in the current scope");
+ }
+
+ // META: quit
+ *theCommandLine << createCommand<Quit>(TUPLE(), "quit", *this, "Stops debugging and quits the client");
+
+ // DBGP: run
+ *theCommandLine << createCommand<Run>(TUPLE(), "run", *this, "Run the query");
+
+ // DBGP: stop
+ *theCommandLine << createCommand<Stop>(TUPLE(), "stop", *this, "Stop the query");
+
+ // DBGP: breakpoint_set
+ {
+ std::set<std::string> lAliases;
+ lAliases.insert("break");
+ Command<CommandLineHandler, TUPLE_STR_STR_INT, BreakpointSet>* lCommand =
+ createCommand<BreakpointSet>(TUPLE_STR_STR_INT(), "bset", lAliases, *this, "Set a breakpoint");
+
+ lCommand->addArgument(0, "s", createArgType<TUPLE_STR_STR_INT, std::string, 0>(TUPLE_STR_STR_INT()), "breakpoint state (optional, 'enabled' or 'disabled', default: enabled)", false);
+ lCommand->addArgument(1, "f", createArgType<TUPLE_STR_STR_INT, std::string, 1>(TUPLE_STR_STR_INT()), "name of the file where to stop", true);
+ lCommand->addArgument(2, "l", createArgType<TUPLE_STR_STR_INT, int, 2>(TUPLE_STR_STR_INT()), "line number", true);
+
+ *theCommandLine << lCommand;
+ }
+
+ // DBGP: breakpoint_get
+ {
+ Command<CommandLineHandler, TUPLE_INT, BreakpointGet>* lCommand =
+ createCommand<BreakpointGet>(TUPLE_INT(), "bget", *this, "Get information about a given breakpoint");
+
+ lCommand->addArgument(0, "d", createArgType<TUPLE_INT, int, 0>(TUPLE_INT()), "breakpoint ID", true);
+
+ *theCommandLine << lCommand;
+ }
+
+ // DBGP: breakpoint_remove
+ {
+ std::set<std::string> lAliases;
+ lAliases.insert("clear");
+ lAliases.insert("delete");
+ Command<CommandLineHandler, TUPLE_INT, BreakpointRemove>* lCommand =
+ createCommand<BreakpointRemove>(TUPLE_INT(), "bremove", lAliases, *this, "Delete a breakpoint");
+
+ lCommand->addArgument(0, "d", createArgType<TUPLE_INT, int, 0>(TUPLE_INT()), "breakpoint ID", true);
+
+ *theCommandLine << lCommand;
+ }
+
+ // DBGP: breakpoint_list
+ *theCommandLine << createCommand<BreakpointList>(TUPLE(), "blist", *this, "List all set breakpoints");
+
+ // DBGP: stack_depth
+ *theCommandLine << createCommand<StackDepth>(TUPLE(), "sdepth", *this, "Get the depth of the stack");
+
+ // DBGP: stack_get
+ {
+ Command<CommandLineHandler, TUPLE_INT, StackGet>* lCommand =
+ createCommand<StackGet>(TUPLE_INT(), "sget", *this, "Get information about one or all stack frames");
+
+ lCommand->addArgument(0, "d", createArgType<TUPLE_INT, int, 0>(TUPLE_INT()), "stack frame to show: 0 for current stack frame, N for the main module (optional, all frames are shown if not provided)", false);
+
+ *theCommandLine << lCommand;
+ }
+
+ // DBGP: context_names
+ *theCommandLine << createCommand<ContextNames>(tuple<>(), "cnames", *this, "Get the names of the avilable contexts");
+ // the DBGP -d arguments for this command is omitted since we always have/return: 0 - Local, 1 - Global
+
+ // DBGP: context_get
+ {
+ Command<CommandLineHandler, TUPLE_INT_INT, ContextGet>* lCommand =
+ createCommand<ContextGet>(TUPLE_INT_INT(), "cget", *this, "Get a context (list variables in this context)");
+
+ lCommand->addArgument(0, "d", createArgType<TUPLE_INT_INT, int, 0>(TUPLE_INT_INT()), "stack depth (optional, default: 0)", false);
+ lCommand->addArgument(0, "c", createArgType<TUPLE_INT_INT, int, 1>(TUPLE_INT_INT()), "context ID: 0 for Local, 1 for Global (optional, default: 0)", false);
+
+ *theCommandLine << lCommand;
+ }
+
+ // DBGP: source
+ {
+ std::set<std::string> lAliases;
+ lAliases.insert("list");
+ Command<CommandLineHandler, TUPLE_INT_INT_STR, Source>* lCommand =
+ createCommand<Source>(TUPLE_INT_INT_STR(), "source", lAliases, *this, "List source code");
+
+ lCommand->addArgument(0, "b", createArgType<TUPLE_INT_INT_STR, int, 0>(TUPLE_INT_INT_STR()), "begin line (optional, default: first line)", false);
+ lCommand->addArgument(1, "e", createArgType<TUPLE_INT_INT_STR, int, 1>(TUPLE_INT_INT_STR()), "end line (optional, default: last line)", false);
+ lCommand->addArgument(2, "f", createArgType<TUPLE_INT_INT_STR, std::string, 2>(TUPLE_INT_INT_STR()), "file URI (optional, default: the file in the top-most stack frame during execution, main module otherwise)", false);
+
+ *theCommandLine << lCommand;
+ }
+
+ // DBGP: eval
+ {
+ std::set<std::string> lAliases;
+ lAliases.insert("print");
+ Command<CommandLineHandler, TUPLE_STR, Eval>* lCommand =
+ createCommand<Eval>(TUPLE_STR(), "eval", lAliases, *this, "Evaluate an expression");
+
+ // TODO: this argument should not be here at all. Eval has the form: eval -i transaction_id -- {DATA}
+ // Eval should be called with a command like: eval 1 + 3
+ // - no need for an argument name
+ // - everything following the fist contiguous set of whitespaces are sent as string
+ lCommand->addArgument(0, "c", createArgType<TUPLE_STR, std::string, 0>(TUPLE_STR()), "expression to evaluate", true);
+
+ *theCommandLine << lCommand;
+ }
+
+ // DBGP: step_in
+ {
+ std::set<std::string> lAliases;
+ lAliases.insert("step");
+ lAliases.insert("s");
+ *theCommandLine << createCommand<StepIn>(TUPLE(), "in", lAliases, *this, "Step in");
+ }
+
+ // DBGP: step_out
+ {
+ std::set<std::string> lAliases;
+ lAliases.insert("finish");
+ *theCommandLine << createCommand<StepOut>(TUPLE(), "out", lAliases, *this, "Step out");
+ }
+
+ // DBGP: step_over
+ {
+ std::set<std::string> lAliases;
+ lAliases.insert("next");
+ lAliases.insert("n");
+ *theCommandLine << createCommand<StepOver>(TUPLE(), "over", lAliases, *this, "Step over");
+ }
+}
+
+} // namespace zorba
+} // namespace debugger
=== added file 'bin/debugger/command_line_handler.h'
--- bin/debugger/command_line_handler.h 1970-01-01 00:00:00 +0000
+++ bin/debugger/command_line_handler.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,182 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_COMMAND_LINE_HANDLER_H
+#define ZORBA_DEBUGGER_COMMAND_LINE_HANDLER_H
+
+#include <set>
+#include <cassert>
+
+#include <zorba/debugger_client.h>
+
+#include "command.h"
+#include "event_handler.h"
+
+
+namespace zorba { namespace debugger {
+
+ class CommandPrompt;
+
+ enum Commands {
+ Status,
+ Variables,
+ Quit,
+ Run,
+ Stop,
+ BreakpointSet,
+ BreakpointGet,
+ BreakpointRemove,
+ BreakpointList,
+ StackDepth,
+ StackGet,
+ ContextNames,
+ ContextGet,
+ Source,
+ Eval,
+ StepIn,
+ StepOut,
+ StepOver
+ };
+
+class CommandLineHandler
+{
+ private:
+
+ typedef std::pair<bool, std::string> bstring;
+ typedef std::pair<bool, int> bint;
+
+ public:
+
+ CommandLineHandler(
+ unsigned short port,
+ LockFreeConsumer<std::size_t>& aConsumer,
+ LockFreeConsumer<bool>& aContinueQueue,
+ EventHandler* aHandler,
+ CommandPrompt* aCommandPrompt);
+
+ ~CommandLineHandler();
+
+ public:
+ void execute();
+
+ public: // Handlers
+
+ template<int>
+ void handle(ZORBA_TR1_NS::tuple<>& aTuple)
+ {
+ assert(false);
+ }
+
+ template<int>
+ void handle(ZORBA_TR1_NS::tuple<bstring, bstring, bint>& t)
+ {
+ assert(false);
+ }
+
+ template<int>
+ void handle(ZORBA_TR1_NS::tuple<bint, bint, bstring>& t)
+ {
+ assert(false);
+ }
+
+ template<int>
+ void handle(ZORBA_TR1_NS::tuple<bint>& aTuple)
+ {
+ assert(false);
+ }
+
+ template<int>
+ void handle(ZORBA_TR1_NS::tuple<bint, bint>& aTuple)
+ {
+ assert(false);
+ }
+
+ template<int>
+ void handle(ZORBA_TR1_NS::tuple<bstring>& aTuple)
+ {
+ assert(false);
+ }
+
+ private:
+ LockFreeConsumer<std::size_t>& theConsumer;
+ LockFreeConsumer<bool>& theContinueQueue;
+ DebuggerClient* theClient;
+ CommandPrompt* theCommandLine;
+ bool theQuit;
+ bool theTerminated;
+ bool theContinue;
+ std::size_t theWaitFor;
+
+ private:
+ void getNextId(std::set<std::size_t>& aIdList);
+ void addCommands();
+};
+
+template<>
+void CommandLineHandler::handle<Status> (ZORBA_TR1_NS::tuple<>& t);
+
+template<>
+void CommandLineHandler::handle<Quit> (ZORBA_TR1_NS::tuple<>& t);
+
+template<>
+void CommandLineHandler::handle<Run> (ZORBA_TR1_NS::tuple<> &t);
+
+template<>
+void CommandLineHandler::handle<Stop> (ZORBA_TR1_NS::tuple<> &t);
+
+template<>
+void CommandLineHandler::handle<StackDepth> (ZORBA_TR1_NS::tuple<>& t);
+
+template<>
+void CommandLineHandler::handle<BreakpointList> (ZORBA_TR1_NS::tuple<>& aTuple);
+
+template<>
+void CommandLineHandler::handle<BreakpointSet> (ZORBA_TR1_NS::tuple<bstring, bstring, bint> &t);
+
+template<>
+void CommandLineHandler::handle<BreakpointGet> (ZORBA_TR1_NS::tuple<bint>& aTuple);
+
+template<>
+void CommandLineHandler::handle<BreakpointRemove>(ZORBA_TR1_NS::tuple<bint> &aTuple);
+
+template<>
+void CommandLineHandler::handle<StackGet> (ZORBA_TR1_NS::tuple<bint>& aTuple);
+
+template<>
+void CommandLineHandler::handle<ContextNames>(ZORBA_TR1_NS::tuple<> &aTuple);
+
+template<>
+void CommandLineHandler::handle<ContextGet>(ZORBA_TR1_NS::tuple<bint, bint> &aTuple);
+
+template<>
+void CommandLineHandler::handle<Source>(ZORBA_TR1_NS::tuple<bint, bint, bstring> &aTuple);
+
+template<>
+void CommandLineHandler::handle<Eval>(ZORBA_TR1_NS::tuple<bstring>& aTuple);
+
+template<>
+void CommandLineHandler::handle<StepIn> (ZORBA_TR1_NS::tuple<> &t);
+
+template<>
+void CommandLineHandler::handle<StepOut> (ZORBA_TR1_NS::tuple<> &t);
+
+template<>
+void CommandLineHandler::handle<StepOver> (ZORBA_TR1_NS::tuple<> &t);
+
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_COMMAND_LINE_HANDLER_H
=== added file 'bin/debugger/command_prompt.cpp'
--- bin/debugger/command_prompt.cpp 1970-01-01 00:00:00 +0000
+++ bin/debugger/command_prompt.cpp 2013-08-27 22:37:07 +0000
@@ -0,0 +1,286 @@
+/*
+ * 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.
+ */
+#include "command_prompt.h"
+
+#include <string>
+#include <vector>
+#include <map>
+#include <iostream>
+
+#include "command.h"
+
+
+namespace zorba { namespace debugger {
+
+#ifdef ZORBA_HAVE_LIBEDIT_H
+const char*
+prompt(EditLine* aEl) {
+ return "(xqdb) ";
+}
+#endif
+
+CommandPrompt::CommandPrompt()
+{
+#ifdef ZORBA_HAVE_LIBEDIT_H
+ theEditLine = el_init("xqdb", stdin, stdout, stderr);
+ theHistory = history_init();
+ HistEvent lHistoryEvent;
+ history(theHistory, &lHistoryEvent, H_SETSIZE, 100);
+
+ el_set(theEditLine, EL_PROMPT, prompt);
+
+ el_set(theEditLine, EL_HIST, history, theHistory);
+ el_set(theEditLine, EL_EDITOR, "emacs");
+#endif
+}
+
+CommandPrompt::~CommandPrompt()
+{
+#ifdef ZORBA_HAVE_LIBEDIT_H
+ history_end(theHistory);
+ el_end(theEditLine);
+#endif
+
+ std::map<std::string, UntypedCommand*>::iterator lIter;
+ for (lIter = theCommands.begin(); lIter != theCommands.end(); ++lIter) {
+ delete lIter->second;
+ }
+}
+
+void
+CommandPrompt::printHelp(UntypedCommand* aCommand)
+{
+ // if no command is provided, print all the available commands
+ if (!aCommand) {
+ std::cout << "Available commands:" << std::endl;
+
+ // print the names of all commands
+ std::map<std::string, UntypedCommand*>::iterator lIter = theCommands.begin();
+ while (lIter != theCommands.end()) {
+ std::cout << " " << (*lIter).first;
+ std::set<std::string> lAliases = (*lIter).second->getAliases();
+ std::set<std::string>::const_iterator lAliasIter = lAliases.begin();
+ while (lAliasIter != lAliases.end()) {
+ std::cout << ", " << *lAliasIter;
+ lAliasIter++;
+ }
+ std::cout << std::endl;
+ lIter++;
+ }
+
+ // some hints for detailed help
+ std::cout << std::endl;
+ std::cout << "Type help <command> to get more information about one command." << std::endl;
+ std::cout << std::endl;
+ } else {
+ // ok, so we have a command; then print the help
+ aCommand->printHelp();
+ }
+}
+
+void
+CommandPrompt::execute()
+{
+ for (;;) {
+#ifdef ZORBA_HAVE_LIBEDIT_H
+ const char* lBuf;
+ int lCharsRead = -1;
+ lBuf = el_gets(theEditLine, &lCharsRead);
+ std::string lCommandLine(lBuf, lCharsRead - 1);
+#else
+ bool lWithOutput = true;
+ if (lWithOutput) {
+ std::cout << "(xqdb) ";
+ }
+ lWithOutput = true;
+ std::string lCommandLine;
+ std::getline(std::cin, lCommandLine);
+ if (std::cin.fail()) {
+ lWithOutput = false;
+ std::cin.clear();
+ continue;
+ }
+#endif
+
+ std::vector<std::string> lArgs;
+
+ // split the command into arguments
+ parseLine(lCommandLine, lArgs);
+ std::string::size_type lSize = lArgs.size();
+
+ // empty command? do nothing!
+ if (lSize == 0) {
+ lArgs = theLastArgs;
+ if (lArgs.size() == 0) {
+ continue;
+ }
+ }
+#ifdef ZORBA_HAVE_LIBEDIT_H
+ else {
+ HistEvent lHistoryEvent;
+ history(theHistory, &lHistoryEvent, H_ENTER, lCommandLine.c_str());
+ }
+#endif
+ theLastArgs = lArgs;
+
+ UntypedCommand* lCommand = NULL;
+
+ // help is not a command but a hook here
+ if (lArgs.at(0) == "h" || lArgs.at(0) == "help") {
+ std::string lCmd = "";
+
+ // if the user needs the help for a specific command
+ if (lSize > 1) {
+ // do nothing if we don't have a command starting with this prefix?
+ // findCommand will print the appropriate errors
+ if (!findCommand(lArgs[1], lCommand)) {
+ continue;
+ }
+ }
+ printHelp(lCommand);
+ continue;
+ }
+ if (findCommand(lArgs[0], lCommand) && lCommand->execute(lArgs)) {
+ return;
+ }
+ continue;
+ }
+}
+
+CommandPrompt&
+CommandPrompt::operator<<(UntypedCommand *aCommand)
+{
+ theCommands.insert(std::make_pair(aCommand->getName(), aCommand));
+ return *this;
+}
+
+bool
+CommandPrompt::findCommand(const std::string& aPrefix, UntypedCommand*& aCommand)
+{
+ std::vector<UntypedCommand*> lFoundCommands;
+
+ std::map<std::string, UntypedCommand*>::iterator lIter = theCommands.begin();
+ while (lIter != theCommands.end()) {
+ // if a command name is equal with the prefix, this is the command we want
+ if ((*lIter).first == aPrefix) {
+ aCommand = (*lIter).second;
+ return true;
+ }
+
+ bool lIsCandidate = false;
+
+ // add this command to candidate commands if the prefix matches
+ if ((*lIter).first.find(aPrefix) == 0) {
+ lFoundCommands.push_back((*lIter).second);
+ lIsCandidate = true;
+ }
+
+ // now process the aliases
+ std::set<std::string> lAliases = (*lIter).second->getAliases();
+ std::set<std::string>::const_iterator lAliasIter = lAliases.begin();
+ while (lAliasIter != lAliases.end()) {
+ // if a command alias is equal with the prefix, this is the command we want
+ if (*lAliasIter == aPrefix) {
+ aCommand = (*lIter).second;
+ return true;
+ }
+
+ // add this command to candidate commands if the prefix matches one alias
+ // and if the command is not already added
+ if (!lIsCandidate && (*lAliasIter).find(aPrefix) == 0) {
+ lFoundCommands.push_back((*lIter).second);
+ break;
+ }
+ lAliasIter++;
+ }
+
+ lIter++;
+ }
+
+ if (lFoundCommands.empty()) {
+ std::cout << "Command not found: " << aPrefix << std::endl;
+ return false;
+ }
+
+ if (lFoundCommands.size() > 1) {
+ std::cout << "Ambigous command: " << aPrefix << std::endl;
+ // show all possible commands that start with this prefix
+ for (std::string::size_type i = 0; i < lFoundCommands.size(); i++) {
+ UntypedCommand* lCommand = lFoundCommands.at(i);
+
+ // commands
+ if (lCommand->getName().find(aPrefix) == 0) {
+ std::cout << " " << lCommand->getName() << std::endl;
+ }
+
+ // and aliases
+ std::set<std::string> lAliases = lCommand->getAliases();
+ std::set<std::string>::const_iterator lAliasIter = lAliases.begin();
+ while (lAliasIter != lAliases.end()) {
+ if ((*lAliasIter).find(aPrefix) == 0) {
+ std::cout << " " << *lAliasIter << std::endl;
+ }
+ lAliasIter++;
+ }
+ }
+ return false;
+ }
+
+ aCommand = lFoundCommands[0];
+ return true;
+}
+
+void
+CommandPrompt::parseLine(const std::string& aLine, std::vector<std::string>& aVector)
+{
+ std::string::size_type lBefore = 0;
+ std::string::size_type lPos = aLine.find_first_of(" \t", 0);
+
+ while (lPos != aLine.npos) {
+ std::string lSub = aLine.substr(lBefore, lPos - lBefore);
+
+ // if two consecutive spaces, you get an empty string here
+ if (lSub != "") {
+ if (lSub[0] == '"') {
+ std::string::size_type lBeforeCopy = lBefore;
+ do {
+ lBeforeCopy = aLine.find("\"", lBeforeCopy + 1);
+ } while (lPos != aLine.npos && aLine.size() > lPos + 1 && aLine[lPos + 1] == '\\');
+ lPos = lBeforeCopy;
+ lSub = aLine.substr(lBefore + 1, lPos - lBefore - 1);
+ }
+ aVector.push_back(lSub);
+ }
+
+ lBefore = lPos + 1;
+ lPos = aLine.find_first_of(" \t", lBefore);
+ }
+ std::string lSub = aLine.substr(lBefore);
+
+ // catching the case when the command ends with a space
+ if (lSub == "") {
+ return;
+ }
+
+ if (lSub[0] == '"') {
+ lPos = aLine.find("\"", lBefore + 1);
+ lSub = aLine.substr(lBefore + 1, lPos - lBefore - 1);
+ }
+ aVector.push_back(lSub);
+}
+
+} // namespace zorba
+} // namespace debugger
=== added file 'bin/debugger/command_prompt.h'
--- bin/debugger/command_prompt.h 1970-01-01 00:00:00 +0000
+++ bin/debugger/command_prompt.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_COMMAND_PROMPT_H
+#define ZORBA_DEBUGGER_COMMAND_PROMPT_H
+
+#include <string>
+#include <map>
+#include <vector>
+
+#include "config.h"
+
+#ifdef ZORBA_HAVE_LIBEDIT_H
+# include <histedit.h>
+#endif
+
+
+namespace zorba { namespace debugger {
+
+class UntypedCommand;
+
+class CommandPrompt
+{
+ public:
+ CommandPrompt();
+ ~CommandPrompt();
+
+ public:
+
+ void execute();
+
+ CommandPrompt& operator<< (UntypedCommand* command);
+
+ private:
+
+ void
+ printHelp(UntypedCommand* command);
+
+ bool
+ findCommand(const std::string& prefix, UntypedCommand*& command);
+
+ void
+ parseLine(const std::string& line, std::vector<std::string>& vector);
+
+ private:
+ std::map<std::string, UntypedCommand*> theCommands;
+ std::vector<std::string> theLastArgs;
+
+#ifdef ZORBA_HAVE_LIBEDIT_H
+ EditLine* theEditLine;
+ History* theHistory;
+#endif
+};
+
+
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_COMMAND_PROMPT_H
=== added file 'bin/debugger/config.h.cmake'
--- bin/debugger/config.h.cmake 1970-01-01 00:00:00 +0000
+++ bin/debugger/config.h.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+// This header is configured by Zorba's build process -- DO NOT EDIT!
+
+#ifndef ZORBA_DEBUGGER_CONFIG_H
+#define ZORBA_DEBUGGER_CONFIG_H
+
+#cmakedefine ZORBA_HAVE_LIBEDIT_H
+
+#endif /* ZORBA_DEBUGGER_CONFIG_H */
=== added file 'bin/debugger/event_handler.cpp'
--- bin/debugger/event_handler.cpp 1970-01-01 00:00:00 +0000
+++ bin/debugger/event_handler.cpp 2013-08-27 22:37:07 +0000
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+
+#include "event_handler.h"
+
+#include <sstream>
+
+#include <zorba/zorba.h>
+#include <zorba/store_manager.h>
+#include <zorba/iterator.h>
+
+namespace zorba { namespace debugger {
+
+EventHandler::EventHandler(LockFreeProducer<std::size_t>& aQueue, LockFreeProducer<bool>& aContProducer)
+ : theIdQueue(aQueue), theContinueProducer(aContProducer),
+ theStore(StoreManager::getStore()),
+ theZorbaInstance(Zorba::getInstance(theStore)),
+ theStaticContext(theZorbaInstance->createStaticContext())
+{
+}
+
+EventHandler::~EventHandler()
+{
+ theStaticContext = 0;
+ theZorbaInstance->shutdown();
+ StoreManager::shutdownStore(theStore);
+}
+
+void
+EventHandler::init()
+{
+ try {
+ Zorba_CompilerHints_t lHints;
+ lHints.opt_level = ZORBA_OPT_LEVEL_O1;
+ zorba::String lProlog("import module namespace dmh = 'http://www.zorba-xquery.com/modules/debugger/dbgp-message-handler';");
+ theStaticContext->loadProlog(lProlog, lHints);
+ } catch (zorba::ZorbaException& e) {
+ std::cerr << "Exception: I was not able to load the query file:" << std::endl;
+ std::cerr << e.what() << std::endl;
+ throw;
+ }
+}
+
+void
+EventHandler::parseMessage(const std::string &aMessage)
+{
+ try {
+#ifndef NDEBUG
+ // uncomment this to see the raw messages received by the event handler
+ //std::cout << "Processing response: " << aMessage << std::endl;
+#endif
+ // the query to process the response
+ std::stringstream lQueryStream;
+ lQueryStream << "dmh:process(" << aMessage << ")";
+ XQuery_t lQuery = theZorbaInstance->compileQuery(lQueryStream.str(), theStaticContext);
+
+ // get the query result sequrence:
+ // 1. a message
+ Iterator_t lIter = lQuery->iterator();
+ Item lItem;
+ lIter->open();
+ lIter->next(lItem);
+ std::size_t lId;
+ std::stringstream lStream(lItem.getStringValue().c_str());
+ lStream >> lId;
+
+ // 2. an "idle" flag (to disable quit confirmation)
+ bool lCanQuit = false;
+ if (lIter->next(lItem)) {
+ String lMessage = lItem.getStringValue();
+ lCanQuit = lMessage == "idle";
+ std::cout << std::endl << lItem.getStringValue() << std::endl;
+ }
+ theContinueProducer.produce(lCanQuit);
+
+ // go and solve the event with this id
+ theIdQueue.produce(lId);
+ } catch (ZorbaException& e) {
+ std::cerr << "FATAL: could not execute query: " << std::endl;
+ std::cerr << e << std::endl;
+ std::cerr << "This is a bug, please report it at http://bugs.launchpad.net/zorba" << std::endl;
+ }
+}
+
+void
+EventHandler::error(unsigned int errcode, const std::string &msg)
+{
+ std::cerr << "Error " << errcode << ": " << msg << std::endl;
+}
+
+} // namespace zorba
+} // namespace debugger
=== added file 'bin/debugger/event_handler.h'
--- bin/debugger/event_handler.h 1970-01-01 00:00:00 +0000
+++ bin/debugger/event_handler.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_EVENT_HANDLER_H
+#define ZORBA_DEBUGGER_EVENT_HANDLER_H
+
+#include <string>
+#include <iostream>
+
+#include <zorba/debugger_event_handler.h>
+#include <zorba/static_context.h>
+
+#include "lock_free_queue.h"
+
+
+namespace zorba { namespace debugger {
+
+class EventHandler : public zorba::DebuggerEventHandler
+{
+ public:
+ EventHandler(
+ LockFreeProducer<std::size_t>& aQueue,
+ LockFreeProducer<bool>& aContQueue);
+
+ ~EventHandler();
+
+ public:
+ virtual void parseMessage(const std::string& aMessage);
+
+ virtual void error(unsigned int errcode, const std::string& msg);
+
+ virtual void init();
+
+ private:
+ LockFreeProducer<std::size_t>& theIdQueue;
+ LockFreeProducer<bool>& theContinueProducer;
+ void* theStore;
+ Zorba* theZorbaInstance;
+ StaticContext_t theStaticContext;
+
+};
+
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_EVENT_HANDLER_H
=== added file 'bin/debugger/lock_free_queue.h'
--- bin/debugger/lock_free_queue.h 1970-01-01 00:00:00 +0000
+++ bin/debugger/lock_free_queue.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,91 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_LOCK_FREE_QUEUE_H
+#define ZORBA_DEBUGGER_LOCK_FREE_QUEUE_H
+
+#include <iostream>
+#include <list>
+
+
+namespace zorba { namespace debugger {
+
+template<typename T>
+class LockFreeProducer
+{
+public:
+ virtual bool produce(const T& aValue) = 0;
+};
+
+template <typename T>
+class LockFreeConsumer {
+public:
+ virtual bool consume(T& result) = 0;
+};
+template<typename T>
+class LockFreeQueue : public LockFreeConsumer<T>, public LockFreeProducer<T>
+{
+public:
+ LockFreeQueue();
+ bool produce(const T& value);
+ bool consume(T& result);
+private:
+ std::list<T> theList;
+ typename std::list<T>::iterator theFirst;
+ typename std::list<T>::iterator theDivider;
+ typename std::list<T>::iterator theLast;
+};
+
+template<typename T>
+LockFreeQueue<T>::LockFreeQueue()
+{
+ theList.push_back(T());
+ theFirst = theDivider = theLast = theList.begin();
+}
+
+template<typename T>
+bool LockFreeQueue<T>::produce(T const &value)
+{
+ typename std::list<T>::iterator lLastInc = theLast;
+ ++lLastInc;
+ lLastInc = theList.insert(lLastInc, value);
+ theLast = lLastInc;
+ while (theFirst != theDivider) {
+ ++theFirst;
+ typename std::list<T>::iterator lFirstDec = theFirst;
+ --lFirstDec;
+ theList.erase(lFirstDec);
+ }
+ return true;
+}
+
+template<typename T>
+bool LockFreeQueue<T>::consume(T &result)
+{
+ if (theDivider != theLast) {
+ typename std::list<T>::iterator lDividerInc = theDivider;
+ ++lDividerInc;
+ result = *(lDividerInc);
+ theDivider = lDividerInc;
+ return true;
+ }
+ return false;
+}
+
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_LOCK_FREE_QUEUE_H
=== added file 'bin/debugger/main.cpp'
--- bin/debugger/main.cpp 1970-01-01 00:00:00 +0000
+++ bin/debugger/main.cpp 2013-08-27 22:37:07 +0000
@@ -0,0 +1,375 @@
+/*
+ * 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.
+ */
+
+#ifdef WIN32
+# include <windows.h>
+# include <string.h>
+# include <strsafe.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <vector>
+
+#include <zorba/config.h>
+
+#include "xqdb_client.h"
+#include "process_listener.h"
+
+
+using namespace zorba;
+using namespace zorba::debugger;
+
+
+std::auto_ptr<XqdbClient> theClient;
+
+// this will make sure the xqdb process will not quit when Ctrl-C is pressed
+#ifdef WIN32
+BOOL WINAPI
+ctrlC_Handler(DWORD aCtrlType)
+{
+ if (CTRL_C_EVENT == aCtrlType) {
+ return true;
+ }
+ return false;
+}
+#else
+void
+ctrlC_Handler(int lParam)
+{
+ // an empty sugnal handler on Linux should do the job
+}
+#endif
+
+
+// this handler function is passed the the zorba process listener and will
+// the client if the zorba process terminates
+void
+onExitProcess(ExitCode aExitCode) {
+ std::cout << std::endl << "Terminating debugger client." << std::endl;
+
+#ifndef WIN32
+ XqdbClient* lClient = theClient.release();
+ if (lClient) {
+ delete lClient;
+ }
+#endif
+
+ exit(aExitCode);
+}
+
+
+int
+startZorba(std::string& aExec, std::vector<std::string>& aArgs, std::auto_ptr<ProcessListener>& aProcessListener)
+{
+#ifdef WIN32
+ // **************************
+ // start a process on Windows
+
+ DWORD iReturnVal = 0;
+
+ std::wstring lExec;
+ std::wstring lArgs;
+
+ lExec.assign(aExec.begin(), aExec.end());
+
+ // the executable must be the first in the list of arguments
+ lArgs.append(L"\"");
+ lArgs.append(lExec);
+ lArgs.append(L"\"");
+
+ for (std::vector<std::string>::size_type j = 0; j < aArgs.size(); j++) {
+ std::string lArg(aArgs.at(j));
+ std::wstring lArgW;
+ lArgW.assign(lArg.begin(), lArg.end());
+ lArgs.append(L" ");
+ lArgs.append(lArgW);
+ }
+
+ // CreateProcessW can modify Parameters thus we allocate needed memory
+ wchar_t * pwszParam = new wchar_t[lArgs.size() + 1];
+ if (pwszParam == 0) {
+ return 1;
+ }
+ const wchar_t* pchrTemp = lArgs.c_str();
+ wcscpy_s(pwszParam, lArgs.size() + 1, pchrTemp);
+
+ // CreateProcess API initialization
+ STARTUPINFOW siStartupInfo;
+ PROCESS_INFORMATION piProcessInfo;
+ memset(&siStartupInfo, 0, sizeof(siStartupInfo));
+ memset(&piProcessInfo, 0, sizeof(piProcessInfo));
+ siStartupInfo.cb = sizeof(siStartupInfo);
+
+ BOOL lResult = CreateProcessW(
+ const_cast<LPCWSTR>(lExec.c_str()),
+ pwszParam, 0, 0, false,
+ CREATE_DEFAULT_ERROR_MODE, 0, 0,
+ &siStartupInfo, &piProcessInfo);
+
+ if (lResult) {
+ // Watch the process
+ aProcessListener.reset(new ProcessListener(piProcessInfo.dwProcessId, &onExitProcess));
+ }
+ else {
+ // CreateProcess failed
+ iReturnVal = GetLastError();
+ LPVOID lpMsgBuf;
+ LPVOID lpDisplayBuf;
+
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ iReturnVal,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &lpMsgBuf,
+ 0, NULL);
+
+ // Display the error message and exit the process
+
+ lpDisplayBuf = (LPVOID)LocalAlloc(
+ LMEM_ZEROINIT,
+ (lstrlen((LPCTSTR)lpMsgBuf) + 40) * sizeof(TCHAR));
+
+ StringCchPrintf(
+ (LPTSTR)lpDisplayBuf,
+ LocalSize(lpDisplayBuf) / sizeof(TCHAR),
+ TEXT("Error (%d) when starting zorba: %s"),
+ iReturnVal,
+ lpMsgBuf);
+
+ std::wstring lErrorW((wchar_t*)lpDisplayBuf);
+ std::string lError;
+ lError.assign(lErrorW.begin(), lErrorW.end());
+ std::cout << lError << std::endl;
+
+ LocalFree(lpMsgBuf);
+ LocalFree(lpDisplayBuf);
+ }
+
+ // Free memory
+ delete[]pwszParam;
+ pwszParam = 0;
+
+ // Release handles
+ CloseHandle(piProcessInfo.hProcess);
+ CloseHandle(piProcessInfo.hThread);
+
+ return iReturnVal;
+
+#else
+ // ************************
+ // start a process on Linux
+
+ pid_t pID = fork();
+ if (pID == 0) {
+ // Code only executed by child process
+ std::stringstream lCommand;
+ lCommand << aExec;
+ for (std::vector<std::string>::size_type j = 0; j < aArgs.size(); j++) {
+ lCommand << " " << aArgs.at(j);
+ }
+
+ int lRes = system(lCommand.str().c_str());
+ exit(lRes);
+ }
+ else {
+ // Code only executed by parent process
+ if (pID < 0) {
+ std::cerr << "Failed to fork Zorba" << std::endl;
+ return pID;
+ }
+
+ // Watch the process
+ aProcessListener.reset(new ProcessListener(pID, &onExitProcess));
+
+ return 0;
+ }
+#endif
+}
+
+void printUsage(std::string& aProgram)
+{
+ std::cerr << "Usage:" << std::endl
+ << " " << aProgram << " <zorba_arguments>" << std::endl
+ << " this will start a debugger command line and a zorba process with the given arguments" << std::endl;
+}
+
+bool
+processArguments(
+ int argc,
+ char* argv[],
+ std::string& aProgram,
+ bool& aStandalone,
+ std::string& aZorba,
+ unsigned int& aPort,
+ std::vector<std::string>& aZorbaArgs)
+{
+ aPort = 28028;
+
+ // find the path to Zorba and this executable name
+ aProgram = argv[0];
+
+#ifdef WIN32
+ char lSep = '\\';
+#else
+ char lSep = '/';
+#endif
+ std::string::size_type lPos = aProgram.find_last_of(lSep);
+
+ std::stringstream lZs;
+
+ if (lPos == aProgram.npos) {
+ lZs << "." << lSep;
+ } else {
+ lZs << aProgram.substr(0, lPos + 1);
+ aProgram = aProgram.substr(lPos + 1);
+ }
+ lZs << "zorba";
+#ifdef WIN32
+ lZs << ".exe";
+#endif
+ aZorba = lZs.str();
+
+
+ bool lHasFileArg = false;
+ bool lHasQueryArg = false;
+ bool lHasQueryVal = false;
+
+ // find if the user asked for help or specified a specific port
+ for (int i = 1; i < argc; i++) {
+ std::string lArg = argv[i];
+ if (lArg == "-h" || lArg == "--help") {
+ return false;
+ }
+ else if (lArg == "-p" || lArg == "--debug-port") {
+ // if there is one more argument
+ if (i < argc - 1) {
+ // get the port value
+ int lPort;
+ std::stringstream lStream(argv[i + 1]);
+ lStream >> lPort;
+ if (!lStream.fail()) {
+ aPort = lPort;
+ }
+ }
+ }
+ else if (lArg == "-f") {
+ lHasFileArg = true;
+ }
+ else if (lArg == "-q") {
+ lHasQueryArg = true;
+ if (++i < argc) {
+ lHasQueryVal = true;
+ }
+ }
+ }
+
+ if (!lHasFileArg || !lHasQueryArg || !lHasQueryVal) {
+ std::cout << "Not enough arguments to start Zorba." << std::endl;
+ std::cout << "Running the standalone XQuery debugger client on port: " << aPort << std::endl;
+ return true;
+ }
+
+ // zorba will need the -d flag
+ aZorbaArgs.push_back("-d");
+
+ // gather all arguments (excepting the program name)
+ for (int i = 1; i < argc; i++) {
+ aZorbaArgs.push_back(argv[i]);
+ }
+
+ aStandalone = false;
+ return true;
+}
+
+#ifndef _WIN32_WCE
+int
+main(int argc, char* argv[])
+#else
+int
+_tmain(int argc, _TCHAR* argv[])
+#endif
+{
+#ifdef WIN32
+ SetConsoleCtrlHandler(ctrlC_Handler, TRUE);
+#else
+ signal(SIGINT, ctrlC_Handler);
+#endif
+
+ // **************************************************************************
+ // processing arguments
+
+ std::string lProgram, lZorbaExec;
+ unsigned int lPort = 28028;
+ std::vector<std::string> lZorbaArgs;
+
+ bool lStandalone = true;
+ if (!processArguments(argc, argv, lProgram, lStandalone, lZorbaExec, lPort, lZorbaArgs)) {
+ printUsage(lProgram);
+ return 1;
+ }
+
+#ifndef NDEBUG
+ // **************************************************************************
+ // debug reporting
+
+ if (!lStandalone) {
+ std::cout << "Communication port: " << lPort << std::endl;
+ std::cout << "Zorba executable: " << lZorbaExec << std::endl;
+ std::cout << "Zorba arguments: ";
+ for (std::vector<std::string>::size_type j = 0; j < lZorbaArgs.size(); j++) {
+ std::cout << lZorbaArgs.at(j) << " ";
+ }
+ std::cout << std::endl;
+ }
+#endif
+
+ try {
+ // **************************************************************************
+ // start a zorba
+
+ // This is a process listener used to watch the Zorba process termination.
+ std::auto_ptr<ProcessListener> lProcessListener;
+
+ if (!lStandalone) {
+ int lResult = startZorba(lZorbaExec, lZorbaArgs, lProcessListener);
+ if (lResult) {
+ return lResult;
+ }
+ } else {
+ std::cout << "Listening for an incomming Zorba connection on port " << lPort << "..." << std::endl;
+ }
+
+ // **************************************************************************
+ // start the debugger command line
+
+ theClient.reset(new XqdbClient(lPort));
+ theClient->start();
+
+ } catch (...) {
+ return -1;
+ }
+
+#ifndef WIN32
+ XqdbClient* lClient = theClient.release();
+ if (lClient) {
+ delete lClient;
+ }
+#endif
+
+ return 0;
+}
=== added file 'bin/debugger/process_listener.cpp'
--- bin/debugger/process_listener.cpp 1970-01-01 00:00:00 +0000
+++ bin/debugger/process_listener.cpp 2013-08-27 22:37:07 +0000
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ */
+
+#include "process_listener.h"
+
+#include <iostream>
+
+#ifndef WIN32
+#include <unistd.h>
+#endif
+
+#ifdef ZORBA_HAVE_PTHREAD_H
+# include <cassert>
+#endif
+
+
+namespace zorba { namespace debugger {
+
+ProcessListener::ProcessListener(ProcessId aProcessID, ExitCallbackType aCallback)
+ : theProcessID(aProcessID), theCallback(aCallback)
+{
+#ifdef WIN32
+ theThread = CreateThread(NULL, 0, &run, (void*) this, 0, &theThreadId);
+#else
+ if (pthread_create(&theThread, NULL, &run, (void*) this)) {
+ assert(false);
+ }
+#endif
+}
+
+ProcessListener::~ProcessListener()
+{
+}
+
+ProcessId
+ProcessListener::getProcessID()
+{
+ return theProcessID;
+}
+
+ExitCallbackType
+ProcessListener::getCallback()
+{
+ return theCallback;
+}
+
+
+ZORBA_THREAD_RETURN
+ProcessListener::run(void* params)
+{
+ ProcessListener* lThis = static_cast<ProcessListener*>(params);
+ ExitCode lExitCode = -1;
+ ProcessId lPid = lThis->getProcessID();
+
+#ifdef WIN32
+ HANDLE lProcessHandle = OpenProcess(SYNCHRONIZE, false, lPid);
+ if (lProcessHandle != NULL) {
+ // wait for the process to exit
+ DWORD lResult = WaitForSingleObject(lProcessHandle, INFINITE);
+
+ // find out the process exit code if possible
+ if (!GetExitCodeProcess(lProcessHandle, &lExitCode)) {
+ lExitCode = -1;
+ }
+ DWORD dw = GetLastError();
+
+ // wait a little for zorba to dump the garbage
+ Sleep(1000);
+ }
+#else
+ int lChildExitStatus;
+
+ // wait for the process to exit
+ waitpid(lPid, &lChildExitStatus, 0);
+
+ // find out the process exit code if possible
+ if (WIFEXITED(lChildExitStatus)) {
+ lExitCode = WEXITSTATUS(lChildExitStatus);
+ }
+
+ // wait a little for zorba to dump the garbage
+ sleep(1);
+#endif
+
+ // and call the callback when this happened
+ ExitCallbackType lCallback = lThis->getCallback();
+ lCallback(lExitCode);
+
+ for (int i = 0; i < 10; i++) {
+ std::cout << i << std::endl;
+ }
+ return NULL;
+}
+
+} // namespace zorba
+} // namespace debugger
=== added file 'bin/debugger/process_listener.h'
--- bin/debugger/process_listener.h 1970-01-01 00:00:00 +0000
+++ bin/debugger/process_listener.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_PROCESS_LISTENER_H
+#define ZORBA_DEBUGGER_PROCESS_LISTENER_H
+
+#include <zorba/config.h>
+
+#ifdef ZORBA_HAVE_PTHREAD_H
+# include <pthread.h>
+# include <sys/wait.h>
+ typedef pthread_t ThreadId;
+ typedef pid_t ProcessId;
+ typedef int ExitCode;
+# define ZORBA_THREAD_RETURN void *
+#else
+# include <windows.h>
+ typedef DWORD ThreadId;
+ typedef DWORD ProcessId;
+ typedef DWORD ExitCode;
+# define ZORBA_THREAD_RETURN DWORD WINAPI
+#endif
+
+typedef void (*ExitCallbackType)(ExitCode);
+
+
+namespace zorba { namespace debugger {
+
+class ProcessListener
+{
+ public:
+ ProcessListener(ProcessId processID, ExitCallbackType callback);
+
+ ~ProcessListener();
+
+ ProcessId
+ getProcessID();
+
+ ExitCallbackType
+ getCallback();
+
+ private:
+
+ static ZORBA_THREAD_RETURN run(void* params);
+
+ private:
+
+#ifdef ZORBA_HAVE_PTHREAD_H
+ pthread_t theThread;
+#else
+ ThreadId theThreadId;
+ HANDLE theThread;
+#endif
+
+ ProcessId theProcessID;
+ ExitCallbackType theCallback;
+};
+
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_PROCESS_LISTENER_H
=== added file 'bin/debugger/tuple.h'
--- bin/debugger/tuple.h 1970-01-01 00:00:00 +0000
+++ bin/debugger/tuple.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_TUPLE_H
+#define ZORBA_DEBUGGER_TUPLE_H
+
+#include <zorba/config.h>
+
+#if ZORBA_TR1_IN_TR1_SUBDIRECTORY
+# include <tr1/tuple>
+#else
+# include <tuple>
+#endif
+
+#endif // ZORBA_DEBUGGER_TUPLE_H
=== added file 'bin/debugger/xqdb_client.cpp'
--- bin/debugger/xqdb_client.cpp 1970-01-01 00:00:00 +0000
+++ bin/debugger/xqdb_client.cpp 2013-08-27 22:37:07 +0000
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+#include "xqdb_client.h"
+
+#include <iostream>
+
+#ifdef ZORBA_HAVE_PTHREAD_H
+# include <cassert>
+#endif
+
+
+namespace zorba { namespace debugger {
+
+XqdbClient::XqdbClient(unsigned int aPort)
+{
+ theIdQueue = new LockFreeQueue<std::size_t>();
+ theQuitQueue = new LockFreeQueue<bool>();
+ theEventHandler = new EventHandler(*theIdQueue, *theQuitQueue);
+ theEventHandler->init();
+
+ theCommandPrompt = new CommandPrompt();
+ theCommandLineHandler = new CommandLineHandler(aPort, *theIdQueue, *theQuitQueue, theEventHandler, theCommandPrompt);
+}
+
+XqdbClient::~XqdbClient()
+{
+ if (theCommandLineHandler) {
+ delete theCommandLineHandler;
+ }
+ if (theCommandPrompt) {
+ delete theCommandPrompt;
+ }
+ if (theEventHandler) {
+ delete theEventHandler;
+ }
+
+ delete theIdQueue;
+ delete theQuitQueue;
+}
+
+void
+XqdbClient::start()
+{
+ theCommandLineHandler->execute();
+}
+
+
+} // namespace zorba
+} // namespace debugger
=== added file 'bin/debugger/xqdb_client.h'
--- bin/debugger/xqdb_client.h 1970-01-01 00:00:00 +0000
+++ bin/debugger/xqdb_client.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_XQDB_CLIENT_H
+#define ZORBA_DEBUGGER_XQDB_CLIENT_H
+
+#include "command_prompt.h"
+#include "command_line_handler.h"
+
+
+namespace zorba { namespace debugger {
+
+class XqdbClient {
+
+ public:
+
+ XqdbClient(unsigned int aPort);
+
+ ~XqdbClient();
+
+ void
+ start();
+
+ private:
+
+ LockFreeQueue<std::size_t>* theIdQueue;
+ LockFreeQueue<bool>* theQuitQueue;
+
+ EventHandler* theEventHandler;
+ CommandPrompt* theCommandPrompt;
+ CommandLineHandler* theCommandLineHandler;
+};
+
+
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_XQDB_CLIENT_H
=== added file 'bin/path_util.cpp'
--- bin/path_util.cpp 1970-01-01 00:00:00 +0000
+++ bin/path_util.cpp 2013-08-27 22:37:07 +0000
@@ -0,0 +1,85 @@
+/*
+ * 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.
+ */
+
+#include "path_util.h"
+
+#include <stdlib.h>
+//#include "zorba/zorba_string.h"
+#include "zorba/util/path.h"
+
+#include "util.h"
+#include "zorbacmdproperties.h"
+#include <zorba/static_context.h>
+
+namespace zorba {
+
+namespace PathUtil {
+
+void
+tokenizePath(
+ const std::string& aPathStr,
+ std::vector<String>& aResult)
+{
+ std::vector<std::string> lPath;
+#ifdef WIN32
+ Util::tokenize(aPathStr, ";", lPath);
+#else
+ Util::tokenize(aPathStr, ":", lPath);
+#endif
+ for (std::vector<std::string>::iterator lIter = lPath.begin();
+ lIter != lPath.end(); ++lIter) {
+ aResult.push_back(*lIter);
+ }
+}
+
+void
+setPathsOnContext(
+ const ZorbaCMDProperties& aProperties,
+ StaticContext_t& aStaticCtx)
+{
+ std::vector<String> lPath;
+ std::string lPathStr;
+
+ // Compute the current working directory to append to all paths.
+ filesystem_path lCWD;
+
+ // setModulePaths() *overwrites* the URI path and lib path, so there's no
+ // sense in calling both. So if --module-path exists, just use it.
+ aProperties.getModulePath(lPathStr);
+ if (lPathStr.length() > 0) {
+ tokenizePath(lPathStr, lPath);
+ lPath.push_back(lCWD.get_path());
+ aStaticCtx->setModulePaths(lPath);
+ }
+ else {
+ // Compute and set URI path
+ aProperties.getURIPath(lPathStr);
+ tokenizePath(lPathStr, lPath);
+ lPath.push_back(lCWD.get_path());
+ aStaticCtx->setURIPath(lPath);
+ lPath.clear();
+
+ // Compute and set lib path
+ aProperties.getLibPath(lPathStr);
+ tokenizePath(lPathStr, lPath);
+ lPath.push_back(lCWD.get_path());
+ aStaticCtx->setLibPath(lPath);
+ }
+}
+
+} /* namespace ModulePath */
+
+} /* namespace zorba */
=== added file 'bin/path_util.h'
--- bin/path_util.h 1970-01-01 00:00:00 +0000
+++ bin/path_util.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+#ifndef ZORBA_MODULE_PATH_H
+#define ZORBA_MODULE_PATH_H
+
+#include <vector>
+#include <string>
+#include <zorba/api_shared_types.h>
+
+class ZorbaCMDProperties;
+
+namespace zorba {
+
+ class String;
+
+ namespace PathUtil {
+
+ void
+ setPathsOnContext(const ZorbaCMDProperties& aProperties,
+ zorba::StaticContext_t& aStaticCtx);
+
+ void
+ tokenizePath(const std::string& aPathStr, std::vector<String>& aResult);
+
+ }
+} /* namespace zorba */
+
+#endif
=== added directory 'bin/test'
=== added file 'bin/test.xml'
--- bin/test.xml 1970-01-01 00:00:00 +0000
+++ bin/test.xml 2013-08-27 22:37:07 +0000
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<test>
+ <child>child1</child>
+ <child>child2</child>
+ <child>child3</child>
+</test>
=== added file 'bin/test/mymod.xq'
--- bin/test/mymod.xq 1970-01-01 00:00:00 +0000
+++ bin/test/mymod.xq 2013-08-27 22:37:07 +0000
@@ -0,0 +1,23 @@
+(:
+ : Copyright 2006-2009 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.
+:)
+
+module namespace foo = "http://www.28msec.com/foo";
+
+declare function foo:test() {
+ if (fn:true())
+ then 1
+ else $a
+};
=== added file 'bin/test/mymod2.xq'
--- bin/test/mymod2.xq 1970-01-01 00:00:00 +0000
+++ bin/test/mymod2.xq 2013-08-27 22:37:07 +0000
@@ -0,0 +1,17 @@
+(:
+ : Copyright 2006-2009 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.
+:)
+
+module namespace i = "i";
=== added file 'bin/test/option.xq'
--- bin/test/option.xq 1970-01-01 00:00:00 +0000
+++ bin/test/option.xq 2013-08-27 22:37:07 +0000
@@ -0,0 +1,19 @@
+(:
+ : Copyright 2006-2009 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.
+:)
+
+import module namespace i = "http://www.zorba-xquery.com/modules/introspection/sctx";
+
+i:option(fn:QName("http://www.zorba-xquery.com", "option"))
=== added file 'bin/test/sequential_expr_err.xq'
--- bin/test/sequential_expr_err.xq 1970-01-01 00:00:00 +0000
+++ bin/test/sequential_expr_err.xq 2013-08-27 22:37:07 +0000
@@ -0,0 +1,23 @@
+(:
+ : Copyright 2006-2009 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.
+:)
+
+declare %sequential function local:foo()
+{
+ 1
+};
+
+<foo> { local:foo() } </foo>
+
=== added file 'bin/util.cpp'
--- bin/util.cpp 1970-01-01 00:00:00 +0000
+++ bin/util.cpp 2013-08-27 22:37:07 +0000
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+#include "util.h"
+
+namespace zorba {
+
+ void
+ Util::tokenize(const std::string& str,
+ const std::string& delimiters,
+ std::vector<std::string>& tokens)
+ {
+ std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
+
+ std::string::size_type pos = str.find_first_of(delimiters, lastPos);
+
+ while (std::string::npos != pos || std::string::npos != lastPos) {
+ tokens.push_back(str.substr(lastPos, pos - lastPos));
+ lastPos = str.find_first_not_of(delimiters, pos);
+ pos = str.find_first_of(delimiters, lastPos);
+ }
+ }
+
+} /* namespace zorba */
=== added file 'bin/util.h'
--- bin/util.h 1970-01-01 00:00:00 +0000
+++ bin/util.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+#ifndef ZORBA_UTIL_H
+#define ZORBA_UTIL_H
+
+#include <vector>
+#include <string>
+
+namespace zorba {
+
+ class Util {
+ public:
+ static void
+ tokenize(const std::string& str,
+ const std::string& delimiters,
+ std::vector<std::string>& tokens);
+
+ };
+} /* namespace zorba */
+
+#endif
+
=== added file 'bin/zorbacmd.cpp'
--- bin/zorbacmd.cpp 1970-01-01 00:00:00 +0000
+++ bin/zorbacmd.cpp 2013-08-27 22:37:07 +0000
@@ -0,0 +1,1322 @@
+/*
+ * 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.
+ */
+
+#include "zorbacmdproperties.h"
+
+#include <memory>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <vector>
+#include <string>
+#include <cassert>
+
+#ifdef WIN32
+#include <windows.h>
+#define sleep(s) Sleep(s*1000)
+#endif
+
+#include <zorba/zorba.h>
+#include <zorba/file.h>
+#include <zorba/zorba_exception.h>
+#include <zorba/xquery_exception.h>
+#include <zorba/document_manager.h>
+#include <zorba/item_sequence.h>
+#include <zorba/iterator.h>
+#include <zorba/xquery_functions.h>
+#include <zorba/uri_resolvers.h>
+#include <zorba/serialization_callback.h>
+#include <zorba/audit.h>
+#include <zorba/audit_scoped.h>
+
+#include <zorba/store_manager.h>
+
+//#define DO_AUDIT
+
+#ifdef DO_AUDIT
+#include <zorba/audit.h>
+#include <zorba/audit_scoped.h>
+#endif
+
+#include "util.h"
+#include "path_util.h"
+
+// For setting the base URI from the current directory
+#include <zorba/util/path.h>
+
+// Timing utilities, including wall-clock timing
+#include <zorba/util/time.h>
+
+// toggle this to allow configuration via a system properties file
+// (see src/system/properties.*)
+#define ZORBACMD_LOAD_SYSTEM_PROPERTIES 1
+
+#if ZORBACMD_LOAD_SYSTEM_PROPERTIES
+# include "system/properties.h"
+#endif
+
+//#define DO_AUDIT
+
+using namespace zorba;
+namespace zorbatm = zorba::time;
+
+const char *copyright_str =
+ "Copyright 2006-2009 The FLWOR Foundation.\n"
+ "License: Apache License 2.0: <http://www.apache.org/licenses/LICENSE-2.0>";
+
+#define PATH_SEP (zorba::filesystem_path::get_directory_separator ())
+
+#ifndef ZORBA_NO_FULL_TEXT
+OneToOneURIMapper theStopWordsMapper(EntityData::STOP_WORDS);
+OneToOneURIMapper theThesaurusMapper(EntityData::THESAURUS);
+#endif
+
+
+/*******************************************************************************
+
+********************************************************************************/
+class URIMapperSerializationCallback : public SerializationCallback
+{
+private:
+ std::vector<URIMapper*> theURIMappers;
+
+public:
+ void addURIMapper(URIMapper* mapper) { theURIMappers.push_back(mapper); }
+
+ URIMapper* getURIMapper(size_t i) const { return theURIMappers[i]; }
+};
+
+
+URIMapperSerializationCallback theSerializationCallback;
+
+/*******************************************************************************
+
+********************************************************************************/
+static void print_exception( ZorbaException const &e,
+ ZorbaCMDProperties const &props ) {
+ using namespace std;
+
+ if ( props.printErrorsAsXml() )
+ if ( props.indent() )
+ cerr << ZorbaException::format_xml_indented;
+ else
+ cerr << ZorbaException::format_xml;
+ else
+ cerr << ZorbaException::format_text;
+
+ cerr << e << endl;
+}
+
+/*******************************************************************************
+
+********************************************************************************/
+bool populateStaticContext(
+ Zorba* zorba,
+ zorba::StaticContext_t& sctx,
+ const ZorbaCMDProperties& props)
+{
+ try
+ {
+ // add the following module path to the static context (in this order)
+ // 1. command-line properties
+ // 2. environment ZORBA_MODULE_PATH
+ // 3. current working directory
+ {
+ std::vector<String> lModulePath;
+ PathUtil::setPathsOnContext(props, sctx);
+ }
+
+ if (props.boundarySpace().size() != 0 )
+ {
+ sctx->setBoundarySpacePolicy(props.boundarySpace().compare("preserve") == 0 ?
+ preserve_space :
+ strip_space);
+ }
+
+ if (props.constructionMode().size() != 0)
+ {
+ sctx->setConstructionMode(props.boundarySpace().compare("preserve") == 0 ?
+ preserve_cons :
+ strip_cons);
+ }
+
+ if (props.orderingMode().size() != 0 )
+ {
+ sctx->setOrderingMode(props.boundarySpace().compare("ordered") == 0 ?
+ ordered :
+ unordered);
+ }
+
+ if (props.baseUri().size() != 0 )
+ sctx->setBaseURI( props.baseUri() );
+ }
+ catch (const zorba::ZorbaException& ze)
+ {
+ std::cerr << ze << std::endl;
+ return false;
+ }
+
+ if (props.defaultCollation().size() != 0 )
+ {
+ try
+ {
+ sctx->addCollation( props.defaultCollation() );
+ }
+ catch (zorba::ZorbaException const&)
+ {
+ std::cerr << "the given collation {" << props.defaultCollation()
+ << "} is not a valid collation." << std::endl;
+ return false;
+ }
+
+ sctx->setDefaultCollation( props.defaultCollation() );
+ }
+
+ ZorbaCMDProperties::Options_t::const_iterator lIter = props.optionsBegin();
+ ZorbaCMDProperties::Options_t::const_iterator end = props.optionsEnd();
+ for (; lIter != end; ++lIter)
+ {
+ try
+ {
+ Item lQName = zorba->getItemFactory()->createQName(lIter->clark_qname);
+ sctx->declareOption(lQName, lIter->value);
+ }
+ catch (zorba::ZorbaException const& e)
+ {
+ std::cerr << "unable to set static context option with qname "
+ << lIter->clark_qname << ": " << e.what() << std::endl;
+ return false;
+ }
+ }
+
+#ifdef DO_AUDIT
+ zorba::audit::Provider* lAuditProvider = zorba->getAuditProvider();
+ zorba::audit::Configuration* config = lAuditProvider->createConfiguration();
+ std::vector<zorba::String> property_names;
+ zorba::audit::Configuration::getPropertyNames(property_names);
+
+ bool lIsStatic;
+
+ lIsStatic = zorba::audit::Configuration::
+ enableProperty(config, property_names, "xquery/compilation/parse-duration");
+ assert(lIsStatic);
+
+ lIsStatic = zorba::audit::Configuration::
+ enableProperty(config, property_names, "xquery/compilation/translation-duration");
+ assert(lIsStatic);
+
+ lIsStatic = zorba::audit::Configuration::
+ enableProperty(config, property_names, "xquery/compilation/optimization-duration");
+ assert(lIsStatic);
+
+ lIsStatic = zorba::audit::Configuration::
+ enableProperty(config, property_names, "xquery/compilation/codegeneration-duration");
+ assert(lIsStatic);
+
+ zorba::audit::Event* event = lAuditProvider->createEvent(config);
+
+ sctx->setAuditEvent(event);
+#endif // DO_AUDIT
+
+#ifndef ZORBA_NO_FULL_TEXT
+ {
+ ZorbaCMDProperties::FullText_t::const_iterator lIter = props.stopWordsBegin();
+ ZorbaCMDProperties::FullText_t::const_iterator end = props.stopWordsEnd();
+ for (; lIter != end; ++lIter)
+ {
+ theStopWordsMapper.addMapping(lIter->uri, lIter->value);
+ }
+
+ if (props.serializePlan() || props.loadPlan())
+ {
+ theSerializationCallback.addURIMapper(&theStopWordsMapper);
+ }
+ else
+ {
+ sctx->registerURIMapper(&theStopWordsMapper);
+ }
+ }
+
+ {
+ ZorbaCMDProperties::FullText_t::const_iterator lIter = props.thesaurusBegin();
+ ZorbaCMDProperties::FullText_t::const_iterator end = props.thesaurusEnd();
+ for (; lIter != end; ++lIter)
+ {
+ theThesaurusMapper.addMapping(lIter->uri, lIter->value);
+ }
+
+ if (props.serializePlan() || props.loadPlan())
+ {
+ theSerializationCallback.addURIMapper(&theStopWordsMapper);
+ }
+ else
+ {
+ sctx->registerURIMapper(&theThesaurusMapper);
+ }
+ }
+#endif /* ZORBA_NO_FULL_TEXT */
+
+ return true;
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+bool populateDynamicContext(
+ Zorba* zorba,
+ zorba::DynamicContext* aDynamicContext,
+ const ZorbaCMDProperties& props)
+{
+ if ( props.contextItem().size() != 0 )
+ {
+ XmlDataManager* lXmlMgr = zorba->getXmlDataManager();
+ std::ifstream lInStream(props.contextItem().c_str());
+ Item lDoc = lXmlMgr->parseXML(lInStream);
+ aDynamicContext->setContextItem(lDoc);
+ }
+
+ ZorbaCMDProperties::ExternalVars_t::const_iterator lIter;
+ ZorbaCMDProperties::ExternalVars_t::const_iterator end = props.externalVarsEnd();
+ for (lIter = props.externalVarsBegin();
+ lIter != end;
+ ++lIter)
+ {
+ try
+ {
+ if ((*lIter).inline_file)
+ {
+ XmlDataManager* lXmlMgr = zorba->getXmlDataManager();
+ std::ifstream lInStream((*lIter).var_value.c_str());
+ Item lDoc = lXmlMgr->parseXML(lInStream);
+ aDynamicContext->setVariable((*lIter).var_name, lDoc);
+ }
+ else
+ {
+ zorba::Item lItem = zorba->getItemFactory()->createString((*lIter).var_value);
+ aDynamicContext->setVariable((*lIter).var_name, lItem);
+ }
+ }
+ catch (...)
+ {
+ // Let normal exception handling display the error message; here we
+ // just want to tell the user what variable binding caused the problem
+ std::cerr << "While binding external variable $"
+ << lIter->var_name << ": ";
+ throw;
+ }
+ }
+ return true;
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+bool createSerializerOptions(
+ Zorba_SerializerOptions_t& lSerOptions,
+ const ZorbaCMDProperties& props)
+{
+ if ( props.indent() )
+ lSerOptions.indent = ZORBA_INDENT_YES;
+
+ if ( props.omitXmlDeclaration() )
+ lSerOptions.omit_xml_declaration = ZORBA_OMIT_XML_DECLARATION_YES;
+
+ if ( props.byteOrderMark() )
+ lSerOptions.byte_order_mark = ZORBA_BYTE_ORDER_MARK_YES;
+
+ if ( props.serializeHtml() )
+ lSerOptions.ser_method = ZORBA_SERIALIZATION_METHOD_HTML;
+ else if ( props.serializeText() )
+ lSerOptions.ser_method = ZORBA_SERIALIZATION_METHOD_TEXT;
+
+ return true;
+}
+
+
+/*******************************************************************************
+ Fullfills the command-line "as-file" (-f) switch, or if not requested, infers
+ -f for file:// queries. Returns an URI or the empty string.
+********************************************************************************/
+std::string parseFileURI(bool asPath, const std::string &str)
+{
+ if (asPath)
+ return str;
+
+ // otherwise, the user still might have meant a file
+#ifdef WIN32
+ // file:///c:/ returns c:<backslash>
+ // file://localhost returns \\localhost
+ // BUG: it seems that <a>/x returns <a>\x
+ static const char *file3 = "file:///";
+ static const char *file2 = "file://";
+ std::string fpath;
+ if(str.compare(0, strlen(file3), file3) == 0) {
+ fpath = str.substr(strlen(file3));
+ } else if(str.compare(0, strlen(file2), file2) == 0) {
+ fpath = PATH_SEP;
+ fpath += str.substr(strlen(file2));
+ }
+ // replace all slash with backslash
+ std::string::size_type off=0;
+ while ((off=fpath.find('/', off)) != std::string::npos)
+ fpath.replace(off, 1, PATH_SEP);
+ return fpath;
+
+#else // for UNIX
+
+ static const char *pfx = "file://";
+ static unsigned plen = strlen (pfx);
+ if (str.compare (0, plen, pfx) == 0)
+ return str.substr (plen);
+ else
+ return "";
+#endif
+}
+
+
+//
+// Timing utilities and class
+//
+
+#define DECLARE_TIMER(kind) \
+ zorbatm::walltime start##kind##Walltime; \
+ zorbatm::walltime stop##kind##Walltime; \
+ zorbatm::cputime start##kind##Cputime; \
+ zorbatm::cputime stop##kind##Cputime; \
+ double elapsed##kind##Walltime; \
+ double elapsed##kind##Cputime
+
+#define START_TIMER(kind) \
+ zorbatm::get_current_walltime(start##kind##Walltime); \
+ zorbatm::get_current_cputime(start##kind##Cputime);
+
+#define STOP_TIMER(kind) \
+ zorbatm::get_current_walltime(stop##kind##Walltime); \
+ elapsed##kind##Walltime += zorbatm::get_walltime_elapsed(start##kind##Walltime, \
+ stop##kind##Walltime); \
+ \
+ zorbatm::get_current_cputime(stop##kind##Cputime); \
+ elapsed##kind##Cputime += zorbatm::get_cputime_elapsed(start##kind##Cputime, \
+ stop##kind##Cputime);
+
+
+
+struct TimingInfo
+{
+ typedef enum
+ {
+ INIT_TIMER,
+ DEINIT_TIMER,
+ COMP_TIMER,
+ EXEC_TIMER,
+ UNLOAD_TIMER,
+ PLAN_SAVE_TIMER,
+ PLAN_LOAD_TIMER,
+ TOTAL_TIMER
+ } TimerKind;
+
+ unsigned long numExecs;
+
+ DECLARE_TIMER(Init);
+ DECLARE_TIMER(Deinit);
+ DECLARE_TIMER(Comp);
+ DECLARE_TIMER(Exec);
+ DECLARE_TIMER(Load);
+ DECLARE_TIMER(Unload);
+ DECLARE_TIMER(PlanSave);
+ DECLARE_TIMER(PlanLoad);
+ DECLARE_TIMER(Total);
+
+ TimingInfo(unsigned long num)
+ :
+ numExecs(num),
+ elapsedInitWalltime(0),
+ elapsedInitCputime(0),
+ elapsedDeinitWalltime(0),
+ elapsedDeinitCputime(0),
+ elapsedCompWalltime(0),
+ elapsedCompCputime(0),
+ elapsedExecWalltime(0),
+ elapsedExecCputime(0),
+ elapsedLoadWalltime(0),
+ elapsedLoadCputime(0),
+ elapsedUnloadWalltime(0),
+ elapsedUnloadCputime(0),
+
+ elapsedPlanSaveWalltime(0),
+ elapsedPlanSaveCputime(0),
+
+ elapsedPlanLoadWalltime(0),
+ elapsedPlanLoadCputime(0),
+
+ elapsedTotalWalltime(0),
+ elapsedTotalCputime(0)
+ {
+ }
+
+ void startTimer(TimerKind kind, unsigned long iteration);
+ void stopTimer(TimerKind kind, unsigned long iteration);
+
+ std::ostream& print(std::ostream& os, bool);
+};
+
+
+void
+TimingInfo::startTimer(TimerKind kind, unsigned long iteration)
+{
+ if (iteration == 0 && numExecs > 1)
+ return;
+
+ switch (kind)
+ {
+ case INIT_TIMER:
+ START_TIMER(Init);
+ break;
+
+ case DEINIT_TIMER:
+ START_TIMER(Deinit);
+ break;
+
+ case TOTAL_TIMER:
+ START_TIMER(Total);
+ break;
+
+ case COMP_TIMER:
+ START_TIMER(Comp);
+ break;
+
+ case EXEC_TIMER:
+ START_TIMER(Exec);
+ break;
+
+ case UNLOAD_TIMER:
+ START_TIMER(Unload);
+ break;
+
+ case PLAN_SAVE_TIMER:
+ START_TIMER(PlanSave);
+ break;
+
+ case PLAN_LOAD_TIMER:
+ START_TIMER(PlanLoad);
+ break;
+ }
+}
+
+
+void
+TimingInfo::stopTimer(TimerKind kind, unsigned long iteration)
+{
+ if (iteration == 0 && numExecs > 1)
+ return;
+
+ switch (kind)
+ {
+ case INIT_TIMER:
+ {
+ STOP_TIMER(Init);
+ break;
+ }
+ case DEINIT_TIMER:
+ {
+ STOP_TIMER(Deinit);
+ break;
+ }
+ case TOTAL_TIMER:
+ {
+ STOP_TIMER(Total);
+ break;
+ }
+ case COMP_TIMER:
+ {
+ STOP_TIMER(Comp);
+ break;
+ }
+ case EXEC_TIMER:
+ {
+ STOP_TIMER(Exec);
+ break;
+ }
+ case UNLOAD_TIMER:
+ {
+ STOP_TIMER(Unload);
+ break;
+ }
+ case PLAN_SAVE_TIMER:
+ {
+ STOP_TIMER(PlanSave);
+ break;
+ }
+ case PLAN_LOAD_TIMER:
+ {
+ STOP_TIMER(PlanLoad);
+ break;
+ }
+ }
+}
+
+
+std::ostream&
+TimingInfo::print(std::ostream& os, bool serializePlan)
+{
+ os.precision(3);
+ os.setf(std::ios::fixed);
+
+ os << "\nNumber of executions = " << numExecs << std::endl;
+
+ unsigned long timeDiv = numExecs == 1 ? 1 : (numExecs - 1);
+ double cWalltime = elapsedCompWalltime / timeDiv;
+ double eWalltime = elapsedExecWalltime / timeDiv;
+ double lWalltime = elapsedLoadWalltime / timeDiv;
+ double uWalltime = elapsedUnloadWalltime / timeDiv;
+ double psWalltime = elapsedPlanSaveWalltime / timeDiv;
+ double plWalltime = elapsedPlanLoadWalltime / timeDiv;
+ double tWalltime = elapsedTotalWalltime / timeDiv;
+
+ double cCputime = elapsedCompCputime / timeDiv;
+ double eCputime = elapsedExecCputime / timeDiv;
+ double lCputime = elapsedLoadCputime / timeDiv;
+ double uCputime = elapsedUnloadCputime / timeDiv;
+ double psCputime = elapsedPlanSaveCputime / timeDiv;
+ double plCputime = elapsedPlanLoadCputime / timeDiv;
+ double tCputime = elapsedTotalCputime / timeDiv;
+
+ os << "Engine Startup Time : " << elapsedInitWalltime
+ << " (user: " << elapsedInitCputime << ")"
+ << " milliseconds" << std::endl;
+
+ os << "Average Compilation Time: " << cWalltime
+ << " (user: " << cCputime << ")"
+ << " milliseconds" << std::endl;
+
+ if (serializePlan)
+ {
+ os << "Average Plan Saving Time: " << psWalltime
+ << " (user: " << psCputime << ")"
+ << " milliseconds" << std::endl;
+
+ os << "Average Plan Loading Time: " << plWalltime
+ << " (user: " << plCputime << ")"
+ << " milliseconds" << std::endl;
+ }
+
+ os << "Average Execution Time : " << eWalltime - lWalltime
+ << " (user: " << eCputime - lCputime << ")"
+ << " milliseconds" << std::endl;
+
+ os << "Average Loading Time : " << lWalltime
+ << " (user: " << lCputime << ")"
+ << " milliseconds" << std::endl;
+
+ os << "Average Unloading Time : " << uWalltime
+ << " (user: " << uCputime << ")"
+ << " milliseconds" << std::endl;
+
+ os << "Average Total Time : " << tWalltime
+ << " (user: " << tCputime << ")"
+ << " milliseconds" << std::endl;
+
+ return os;
+}
+
+
+void
+removeOutputFileIfNeeded(const ZorbaCMDProperties& lProperties)
+{
+#ifdef ZORBA_WITH_FILE_ACCESS
+ if (lProperties.outputFile().size() > 0)
+ {
+ File_t lFile = zorba::File::createFile(lProperties.outputFile());
+ if (lFile->exists())
+ {
+ lFile->remove();
+ }
+ }
+#endif /* ZORBA_WITH_FILE_ACCESS */
+}
+
+
+int
+compileAndExecute(
+ zorba::Zorba* zorbaInstance,
+ const ZorbaCMDProperties& properties,
+ zorba::StaticContext_t& staticContext,
+ const std::string& qfilepath,
+ std::istream& qfile,
+ std::ostream& outputStream,
+ TimingInfo& timing)
+{
+ unsigned long lNumExecutions = properties.multiple();
+ bool lIndent = properties.indent();
+ bool doTiming = properties.timing();
+ bool serializePlan = properties.serializePlan();
+ bool savePlan = properties.savePlan();
+ bool loadPlan = properties.loadPlan();
+ std::ostringstream lOut;
+ Zorba_CompilerHints lHints;
+
+ std::auto_ptr<std::fstream> planFile;
+ std::fstream* planFilep = NULL;
+
+ if (qfilepath.rfind(".jq") == qfilepath.size() - 3)
+ {
+ staticContext->setJSONiqVersion(zorba::jsoniq_version_1_0);
+ }
+
+ if (serializePlan)
+ {
+ if (savePlan || loadPlan)
+ {
+ std::cerr << "The --serialize-plan option cannot be used together with the --compile-plan or --execute-plan options" << std::endl;
+ exit(1);
+ }
+
+ std::string planFilePath = qfilepath;
+ planFilePath += ".plan";
+ planFile.reset(new std::fstream(planFilePath.c_str(),
+ std::fstream::in |
+ std::fstream::out |
+ std::fstream::trunc |
+ std::fstream::binary));
+ planFilep = planFile.get();
+ assert(planFilep->good());
+ }
+
+ if (savePlan && loadPlan)
+ {
+ std::cerr << "The --compile-plan and --execute-plan options cannot be used together" << std::endl;
+ exit(1);
+ }
+
+ // default is O1 in the Zorba_CompilerHints constructor
+ if (properties.optimizationLevel() == "O0")
+ {
+ lHints.opt_level = ZORBA_OPT_LEVEL_O0;
+ }
+ else if (properties.optimizationLevel() == "O2")
+ {
+ lHints.opt_level = ZORBA_OPT_LEVEL_O2;
+ }
+
+ lHints.for_serialization_only = true;
+
+#if ZORBACMD_LOAD_SYSTEM_PROPERTIES
+ if (Properties::instance()->serializeOnlyQuery() == 0)
+ {
+ lHints.for_serialization_only = false;
+ }
+#endif
+
+ // default is false
+ if (properties.libModule())
+ {
+ lHints.lib_module = true;
+ }
+
+ Zorba_SerializerOptions lSerOptions = Zorba_SerializerOptions::SerializerOptionsFromStringParams(properties.getSerializerParameters());
+
+ createSerializerOptions(lSerOptions, properties);
+
+ zorba::XQuery_t query;
+ DiagnosticHandler diagnosticHandler;
+
+ for (unsigned long i = 0; i < lNumExecutions; ++i)
+ {
+ // start the total timer
+ if (doTiming)
+ timing.startTimer(TimingInfo::TOTAL_TIMER, i);
+
+ //
+ // Compile the query
+ // Compilation is done only once, unless timing is needed
+ //
+ if (doTiming || i == 0)
+ {
+ // go back to the beginning of the stream
+ qfile.clear();
+ qfile.seekg(0);
+ assert (qfile.tellg() >= 0);
+
+ try
+ {
+ // start the compilation timer
+ if (doTiming)
+ timing.startTimer(TimingInfo::COMP_TIMER, i);
+
+ // Create and compile the query
+ query = zorbaInstance->createQuery();
+ query->registerDiagnosticHandler(&diagnosticHandler);
+ query->setFileName(qfilepath);
+
+ if (loadPlan)
+ {
+ query->loadExecutionPlan(qfile, &theSerializationCallback);
+
+ // stop the compilation timer
+ if (doTiming)
+ timing.stopTimer(TimingInfo::COMP_TIMER, i);
+ }
+ else
+ {
+ query->compile(qfile, staticContext, lHints);
+
+ // stop the compilation timer
+ if (doTiming)
+ timing.stopTimer(TimingInfo::COMP_TIMER, i);
+
+ // Serialize the execution plan, if requested
+ if (serializePlan)
+ {
+ planFilep->clear();
+ planFilep->seekp(0);
+
+ // start the plan-save timer
+ if (doTiming)
+ timing.startTimer(TimingInfo::PLAN_SAVE_TIMER, i);
+
+ query->saveExecutionPlan(*planFilep, ZORBA_USE_BINARY_ARCHIVE);
+
+ // stop the plan-save timer
+ if (doTiming)
+ timing.stopTimer(TimingInfo::PLAN_SAVE_TIMER, i);
+
+ planFilep->flush();
+ }
+ }
+ }
+ catch (zorba::XQueryException const& qe)
+ {
+ print_exception( qe, properties );
+ return 11;
+ }
+ catch (zorba::ZorbaException const& ze)
+ {
+ std::cerr << ze << std::endl;
+ return 12;
+ }
+ } // if (doTiming || i == 0)
+
+ //
+ // Run the query, unless compileOnly has been requested.
+ //
+ if ( ! properties.compileOnly() && ! properties.libModule() )
+ {
+ try
+ {
+ // load the execution plan, if requested
+ if (serializePlan)
+ {
+ planFilep->seekg(0);
+ assert(planFilep->good());
+
+ // start the plan-load timer
+ if (doTiming)
+ timing.startTimer(TimingInfo::PLAN_LOAD_TIMER, i);
+
+ query = zorbaInstance->createQuery();
+ query->loadExecutionPlan(*planFilep, &theSerializationCallback);
+
+ // stop the plan-load timer
+ if (doTiming)
+ timing.stopTimer(TimingInfo::PLAN_LOAD_TIMER, i);
+ }
+
+ // start the execution timer
+ if (doTiming)
+ timing.startTimer(TimingInfo::EXEC_TIMER, i);
+
+ // Populate the dynamic context
+ zorba::DynamicContext* lDynamicContext = query->getDynamicContext();
+ try
+ {
+ if ( ! populateDynamicContext(zorbaInstance, lDynamicContext, properties) )
+ {
+ properties.printHelp(std::cout);
+ return 21;
+ }
+ }
+ catch (zorba::XQueryException const& qe)
+ {
+ print_exception( qe, properties );
+ return 22;
+ }
+ catch (zorba::ZorbaException const& ze)
+ {
+ std::cerr << ze << std::endl;
+ return 23;
+ }
+
+ // run the query
+ if (properties.noSerializer())
+ {
+ query->executeSAX();
+ }
+ else if (savePlan)
+ {
+ query->saveExecutionPlan(outputStream,
+ ZORBA_USE_BINARY_ARCHIVE,
+ SAVE_UNUSED_FUNCTIONS);
+ }
+ else
+ {
+ query->execute(outputStream, &lSerOptions);
+ }
+
+ if (properties.trailingNl())
+ outputStream << std::endl;
+
+ query->close();
+
+ // stop the execution timer
+ if (doTiming)
+ timing.stopTimer(TimingInfo::EXEC_TIMER, i);
+
+ if (i > 0 || lNumExecutions == 1)
+ {
+ timing.elapsedLoadWalltime += query->getDocLoadingTime();
+ timing.elapsedLoadCputime += query->getDocLoadingUserTime();
+ }
+ }
+ catch (zorba::XQueryException const& qe)
+ {
+ print_exception( qe, properties );
+ return 31;
+ }
+ catch (zorba::ZorbaException const& ze)
+ {
+ std::cerr << ze << std::endl;
+ return 32;
+ }
+ }
+
+ //
+ // Delete all loaded docs from the store, if timing has been requested
+ //
+ if (doTiming)
+ {
+ XmlDataManager* store = zorbaInstance->getXmlDataManager();
+
+ timing.startTimer(TimingInfo::UNLOAD_TIMER, i);
+
+ DocumentManager* docMgr = store->getDocumentManager();
+ ItemSequence_t docsSeq = docMgr->availableDocuments();
+ Iterator_t lIter = docsSeq->getIterator();
+ lIter->open();
+ Item uri;
+ std::vector<Item> docURIs;
+ while (lIter->next(uri))
+ {
+ docURIs.push_back(uri);
+ }
+ lIter->close();
+
+ size_t numDocs = docURIs.size();
+
+ for (size_t k = 0; k < numDocs; ++k)
+ {
+ docMgr->remove(docURIs[k].getStringValue());
+ }
+
+ timing.stopTimer(TimingInfo::UNLOAD_TIMER, i);
+ }
+
+ // stop the total timer
+ if (doTiming)
+ timing.stopTimer(TimingInfo::TOTAL_TIMER, i);
+
+#ifdef DO_AUDIT
+ audit::Event* event = staticContext->getAuditEvent();
+ std::cerr << *event << std::endl;
+#endif
+ } // for each execution
+
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////
+// //
+// Main //
+// //
+/////////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WIN32_WCE
+int
+main(int argc, char* argv[])
+#else
+int
+_tmain(int argc, _TCHAR* argv[])
+#endif
+{
+#if ZORBACMD_LOAD_SYSTEM_PROPERTIES
+ // only configurable via a config file or environment vars
+ zorba::Properties::load(0, NULL);
+#endif
+
+ // parse the command line and/or the properties file
+ ZorbaCMDProperties properties;
+ if (!properties.loadProperties(argc, argv))
+ {
+ return 1;
+ }
+
+ TimingInfo engineTiming(properties.multiple());
+
+ bool doTiming = properties.timing();
+ bool debug = false;
+#ifdef ZORBA_WITH_DEBUGGER
+ debug = (properties.debug());
+#endif
+
+ // libModule assumes compileOnly even if compileOnly is false
+ bool compileOnly = (properties.compileOnly() || properties.libModule() );
+
+ // write to file or standard out
+ std::auto_ptr<std::ostream>
+ lFileStream(
+ #ifdef ZORBA_WITH_FILE_ACCESS
+ properties.outputFile().size() > 0 ?
+ new std::ofstream(properties.outputFile().c_str()) : 0
+ #else /* ZORBA_WITH_FILE_ACCESS */
+ 0
+ #endif /* ZORBA_WITH_FILE_ACCESS */
+ );
+
+ std::ostream* lOutputStream = lFileStream.get();
+ if ( lOutputStream == 0 )
+ {
+ lOutputStream = &std::cout;
+ }
+#ifdef ZORBA_WITH_FILE_ACCESS
+ else if ( !lOutputStream->good() )
+ {
+ std::cerr << "could not write to output file {" << properties.outputFile()
+ << "}" << std::endl;
+ return 2;
+ }
+#endif /* ZORBA_WITH_FILE_ACCESS */
+
+ if (properties.queriesOrFilesBegin() == properties.queriesOrFilesEnd())
+ {
+ std::cerr << "no queries submitted." << std::endl;
+ properties.printHelp(std::cout);
+ return 3;
+ }
+
+ // Add command line --classpath option in front of config/env CLASSPATH
+ Properties* globaproperties = Properties::instance();
+ std::string cmdJvmClassPath;
+ properties.getJVMClassPath(cmdJvmClassPath);
+ std::string configJvmClassPath;
+ globaproperties->getJVMClassPath(configJvmClassPath);
+ globaproperties->setJVMClassPath(cmdJvmClassPath +
+ filesystem_path::get_path_separator() + configJvmClassPath);
+
+ // Start the engine
+
+ engineTiming.startTimer(TimingInfo::INIT_TIMER, 2);
+
+ void* store = zorba::StoreManager::getStore();
+
+ zorba::Zorba* lZorbaInstance = zorba::Zorba::getInstance(store);
+
+#ifdef DO_AUDIT
+ zorba::audit::Provider* lAuditProvider = lZorbaInstance->getAuditProvider();
+
+ zorba::audit::Configuration* config = lAuditProvider->createConfiguration();
+
+ std::vector<zorba::String> property_names;
+ zorba::audit::Configuration::getPropertyNames(property_names);
+
+ zorba::audit::Configuration::
+ enableProperty(config, property_names, "xquery/compilation/parse-duration");
+
+ zorba::audit::Configuration::
+ enableProperty(config, property_names, "xquery/compilation/translation-duration");
+
+ zorba::audit::Configuration::
+ enableProperty(config, property_names, "xquery/compilation/optimization-duration");
+
+ zorba::audit::Configuration::
+ enableProperty(config, property_names, "xquery/compilation/codegeneration-duration");
+#endif
+
+ {
+ engineTiming.stopTimer(TimingInfo::INIT_TIMER, 2);
+
+ // For each query ...
+
+ int queryNo;
+ ZorbaCMDProperties::QueriesOrFiles_t::const_iterator lIter;
+ for (queryNo = 1, lIter = properties.queriesOrFilesBegin();
+ lIter != properties.queriesOrFilesEnd();
+ ++queryNo, ++lIter)
+ {
+ //
+ // Read the query (either from a file or given as parameter)
+ //
+ std::string fURI = *lIter;
+ std::string fname = parseFileURI (properties.asFiles (), fURI);
+ zorba::filesystem_path path (fname);
+ bool asFile = ! fname.empty ();
+ std::auto_ptr<std::istream> qfile;
+
+ if (asFile)
+ {
+ path.resolve_relative ();
+ qfile.reset(new std::ifstream (path.c_str ()));
+ }
+ else
+ {
+ qfile.reset(new std::istringstream(fURI));
+ }
+
+ if (asFile && (!qfile->good() || qfile->eof()))
+ {
+ std::cerr << "file {" << fname << "} not found or not readable." << std::endl;
+ properties.printHelp(std::cout);
+ return 3;
+ }
+ else if (fURI.empty ())
+ {
+ std::cerr << "empty query." << std::endl;
+ properties.printHelp(std::cout);
+ return 3;
+ }
+
+ //
+ // Print the query if requested
+ //
+ if (properties.printQuery())
+ {
+ *lOutputStream << "\nQuery number " << queryNo << " :\n";
+ std::copy (std::istreambuf_iterator<char> (*qfile),
+ std::istreambuf_iterator<char> (),
+ std::ostreambuf_iterator<char> (*lOutputStream));
+ *lOutputStream << std::endl;
+ // go back to the beginning
+ qfile->seekg(0);
+ }
+
+ //
+ // Create the static context and populate it with info taken from the properties
+ //
+ zorba::StaticContext_t lStaticContext = lZorbaInstance->createStaticContext();
+
+ if (! populateStaticContext(lZorbaInstance, lStaticContext, properties) )
+ {
+ properties.printHelp(std::cout);
+ return 3;
+ }
+
+#ifdef DO_AUDIT
+ zorba::audit::Event* event = lAuditProvider->createEvent(config);
+ lStaticContext->setAuditEvent(event);
+#endif // DO_AUDIT
+
+ if (!asFile && properties.baseUri().size() == 0 )
+ {
+ // No user set base URI. Set the cwd to be used as base-uri in order
+ // to make the doc function doc("mydoc.xml") work
+ zorba::filesystem_path p;
+ std::stringstream lTmp;
+ std::vector<std::string> lTokens;
+ Util::tokenize(p.c_str(), PATH_SEP, lTokens);
+
+ lTmp << "file://";
+ for (std::vector<std::string>::const_iterator lIter = lTokens.begin();
+ lIter != lTokens.end(); ++lIter)
+ {
+ zorba::String lTmpString(*lIter);
+ lTmp << '/' << fn::encode_for_uri( lTmpString );
+ }
+
+ lTmp << '/';
+
+ lStaticContext->setBaseURI(lTmp.str());
+ }
+
+ // Parse the query
+ if (properties.parseOnly())
+ {
+ try
+ {
+ zorba::XQuery_t lQuery = lZorbaInstance->createQuery();
+ if (asFile)
+ {
+ lQuery->setFileName(path.get_path());
+ }
+
+ lQuery->parse (*qfile);
+ }
+ catch (zorba::ZorbaException const& ze)
+ {
+ std::cerr << ze << std::endl;
+ return 6;
+ }
+ }
+
+ // Compile and run it if necessary.
+ // Print timing information if requested.
+ else if (!debug)
+ {
+ if (compileOnly)
+ {
+ try
+ {
+ zorba::XQuery_t aQuery = lZorbaInstance->createQuery();
+ if (asFile)
+ {
+ aQuery->setFileName(path.get_path());
+ }
+
+ aQuery->parse(*qfile);
+
+ qfile->clear();
+ qfile->seekg(0); // go back to the beginning
+ }
+ catch (zorba::XQueryException const& qe)
+ {
+ print_exception( qe, properties );
+ return 6;
+ }
+ }
+
+ TimingInfo queryTiming(properties.multiple());
+
+ int status = compileAndExecute(lZorbaInstance,
+ properties,
+ lStaticContext,
+ path.get_path(),
+ *qfile,
+ *lOutputStream,
+ queryTiming);
+ if (status != 0)
+ {
+ // reset the file handler (in case output option was provided)
+ // in order to delete the created output file
+ lFileStream.reset();
+ removeOutputFileIfNeeded(properties);
+ return status;
+ }
+
+ if (doTiming)
+ {
+ bool serializePlan = properties.serializePlan();
+ queryTiming.print(std::cout, serializePlan);
+ }
+ }
+
+#ifdef ZORBA_WITH_DEBUGGER
+ // Debug the query. Do not allow "compileOnly" flags and inline queries
+ else if (debug)
+ {
+ if (compileOnly)
+ {
+ std::cerr << "cannot debug a query if the compileOnly option is specified"
+ << std::endl;
+ return 7;
+ }
+
+ if (!asFile)
+ {
+ std::cerr << "Cannot debug inline queries." << std::endl;
+ return 8;
+ }
+
+ std::auto_ptr<std::istream> lXQ(new std::ifstream(path.c_str()));
+ std::string lFileName(path.get_path());
+
+ zorba::XQuery_t lQuery;
+
+ try
+ {
+ lQuery = lZorbaInstance->createQuery();
+ lQuery->setFileName(lFileName);
+ lQuery->setDebugMode(true);
+
+ Zorba_CompilerHints lHints;
+ lHints.opt_level = ZORBA_OPT_LEVEL_O0;
+
+ lQuery->compile(*lXQ.get(), lHints);
+ zorba::DynamicContext* lDynamicContext = lQuery->getDynamicContext();
+ if (!populateDynamicContext(lZorbaInstance, lDynamicContext, properties)) {
+ return 9;
+ }
+
+ std::string lHost = properties.debugHost();
+ if (lHost == "") {
+ lHost = "127.0.0.1";
+ }
+
+ Zorba_SerializerOptions lSerOptions =
+ Zorba_SerializerOptions::SerializerOptionsFromStringParams(
+ properties.getSerializerParameters());
+ createSerializerOptions(lSerOptions, properties);
+
+ if (!properties.hasNoLogo())
+ {
+ std::cout << "Zorba XQuery Debugger Server\n" << copyright_str << std::endl;
+ }
+
+ lQuery->debug(*lOutputStream, lSerOptions, lHost, properties.getDebugPort());
+ }
+ catch (zorba::XQueryException const& qe)
+ {
+ print_exception( qe, properties );
+ return 5;
+ }
+ catch (zorba::ZorbaException const& ze)
+ {
+ std::cerr << ze << std::endl;
+ return 6;
+ }
+ } // else if (debug)
+#endif
+
+#ifdef DO_AUDIT
+ lAuditProvider->submitEvent(event);
+#endif
+
+ } // for each query
+
+ }
+
+ if (doTiming)
+ {
+ engineTiming.startTimer(TimingInfo::DEINIT_TIMER, 2);
+ }
+
+#ifdef DO_AUDIT
+ lAuditProvider->destroyConfiguration(config);
+#endif
+
+ lZorbaInstance->shutdown();
+ zorba::StoreManager::shutdownStore(store);
+
+ if (doTiming)
+ {
+ engineTiming.stopTimer(TimingInfo::DEINIT_TIMER, 2);
+
+ std::cout << std::endl << "Engine Shutdown Time : "
+ << engineTiming.elapsedDeinitWalltime
+ << " (user: " << engineTiming.elapsedDeinitCputime << ")"
+ << " milliseconds" << std::endl;
+ }
+ return 0;
+}
+/* vim:set et sw=2 ts=2: */
=== added file 'bin/zorbacmdproperties.cpp'
--- bin/zorbacmdproperties.cpp 1970-01-01 00:00:00 +0000
+++ bin/zorbacmdproperties.cpp 2013-08-27 22:37:07 +0000
@@ -0,0 +1,215 @@
+/*
+ * 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.
+ */
+#include "zorbacmdproperties.h"
+
+#include <fstream>
+#include <iostream>
+#include <cstdlib>
+
+#include <zorba/zorba.h>
+
+std::string ZorbaCMDProperties::check_args () {
+
+ if(queriesOrFilesBegin() == queriesOrFilesEnd()) {
+ return "No queries submitted \nUsage: zorba -q '1 + 1' execute an inline query \n zorba -f -q file.xq execute a query from a file \n Use -h for help.";
+ }
+
+ if (getPositionalArgs ().size () != 0) {
+ QueriesOrFiles_t::const_iterator lIter;
+ for (lIter = queriesOrFilesBegin(); lIter != queriesOrFilesEnd();
+ ++lIter)
+ {
+ if (*lIter == "-f")
+ return "Extra arguments found on command line. Possible reason: misplaced -f option (try '-f -q filename' instead of '-q -f filename'). Use -h for help.";
+ }
+
+ return "Extra arguments found on command line. Use -h for help.";
+ }
+
+ if ( theBoundarySpace.size() != 0 )
+ {
+ if ( ! (theBoundarySpace.compare("strip") == 0 || theBoundarySpace.compare("preserve") == 0 ))
+ return "Only strip and preserve are allowed as values for the option boundary-space";
+ }
+
+ if ( theConstructionMode.size() != 0 )
+ {
+ if ( ! (theConstructionMode.compare("strip") == 0 || theConstructionMode.compare("preserve") == 0 ))
+ return "Only strip and preserve are allowed as values for the option construction-mode";
+ }
+
+ if ( theOrderingMode.size() != 0 ) {
+ if ( ! (theOrderingMode.compare("ordered") == 0 || theOrderingMode.compare("unordered") == 0 ))
+ return "Only ordered and unordered are allowed as values for the option ordering-mode";
+ }
+
+ if ( ! (theOptimizationLevel.compare("O0") == 0 || theOptimizationLevel.compare("O1") == 0
+ || theOptimizationLevel.compare("O2") == 0 ) )
+ return "only O0, O1 and O2 are allowed as values for the option opt-level";
+
+ for (std::vector<std::string>::const_iterator lIter = theExternalVariable.begin();
+ lIter != theExternalVariable.end(); ++lIter)
+ {
+ std::string lStr = *lIter;
+ std::string::size_type lPos = lStr.find_first_of("=");
+ std::string lVarName = lStr.substr(0, lPos);
+ std::string lValue = lStr.substr(lPos + 1);
+ bool lInlineFile = true;
+ if (lVarName.at(lVarName.size()-1) == ':')
+ {
+ lInlineFile = false;
+ lVarName.resize(lVarName.size()-1); // remove the :
+ }
+ ExternalVariable lExternalVariable;
+ lExternalVariable.var_name = lVarName;
+ lExternalVariable.var_value = lValue;
+ lExternalVariable.inline_file = lInlineFile;
+ theExternalVars.push_back(lExternalVariable);
+ }
+
+ for (std::vector<std::string>::const_iterator lIter = theOption.begin();
+ lIter != theOption.end(); ++lIter)
+ {
+ size_t lEQual = lIter->find_last_of("=");
+ if (lEQual == std::string::npos)
+ return "option must be of the form {namespace}localname=value";
+
+ std::string lClarkQName = lIter->substr(0, lEQual);
+ std::string lValue = lIter->substr(lEQual + 1);
+
+ StaticContextOption lOption;
+ lOption.clark_qname = lClarkQName;
+ lOption.value = lValue;
+ theStaticContextOptions.push_back(lOption);
+ }
+
+ for (std::vector<std::string>::const_iterator lIter = theStopWords.begin();
+ lIter != theStopWords.end(); ++lIter)
+ {
+ size_t lEQual = lIter->find(":=");
+ if (lEQual == std::string::npos)
+ return "Stop-words mapping must be of the form URI:=value";
+
+ std::string lURI = lIter->substr(0, lEQual);
+ std::string lValue = lIter->substr(lEQual + 2);
+
+ FullTextMapping lMapping;
+ lMapping.uri = lURI;
+ lMapping.value = lValue;
+ theStopWordsMapping.push_back(lMapping);
+ }
+
+ for (std::vector<std::string>::const_iterator lIter = theThesaurus.begin();
+ lIter != theThesaurus.end(); ++lIter)
+ {
+ size_t lEQual = lIter->find(":=");
+ if (lEQual == std::string::npos)
+ return "Thesaurus mapping must be of the form URI:=value";
+
+ std::string lURI = lIter->substr(0, lEQual);
+ std::string lValue = lIter->substr(lEQual + 2);
+
+ if ( lURI == "default" )
+ lURI = "##default";
+
+ FullTextMapping lMapping;
+ lMapping.uri = lURI;
+ lMapping.value = lValue;
+ theThesaurusMapping.push_back(lMapping);
+ }
+
+ return "";
+}
+
+
+bool ZorbaCMDProperties::loadProperties(int argc, char* argv[])
+{
+ std::string result = load_argv(argc, (const char **) argv);
+
+ if (result.empty())
+ result = check_args();
+
+ if (result == "!HELP")
+ {
+ std::cout << "Zorba XQuery Engine, Version: "
+ << zorba::Zorba::version() << std::endl;
+ std::cout << "Available options:\n\n";
+ std::cout << get_help_msg ();
+ return false;
+ }
+ else if (result == "!VER")
+ {
+ std::cout << "Zorba XQuery Engine, Version: "
+ << zorba::Zorba::version() << std::endl;
+ return false;
+ }
+ else if (result.empty ())
+ {
+ return true;
+ }
+ else if (result [0] != '!')
+ {
+ std::cout << "Error: " << result << std::endl;
+ return false;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+void ZorbaCMDProperties::getModulePath(std::string& aPath) const
+{
+ aPath = theModulePath;
+}
+
+void ZorbaCMDProperties::getURIPath(std::string& aPath) const
+{
+ aPath = theUriPath;
+}
+
+void ZorbaCMDProperties::getLibPath(std::string& aPath) const
+{
+ aPath = theLibPath;
+}
+
+void ZorbaCMDProperties::getJVMClassPath(std::string& aPath) const
+{
+ aPath = theClasspath;
+}
+
+std::vector<std::pair<std::string,std::string> > ZorbaCMDProperties::getSerializerParameters() const
+{
+ std::vector<std::pair<std::string,std::string> > lResult;
+ std::vector<std::string>::const_iterator lEnd = theSerializationParameter.end();
+ for (
+ std::vector<std::string>::const_iterator lIter = theSerializationParameter.begin();
+ lIter != lEnd;
+ ++lIter
+ )
+ {
+ std::string lStr = *lIter;
+ std::string::size_type lPos = lStr.find_first_of("=");
+ std::string lVarName = lStr.substr(0, lPos);
+ std::string lValue;
+ if (lPos != std::string::npos)
+ lValue = lStr.substr(lPos + 1);
+
+ lResult.push_back(std::pair<std::string,std::string>(lVarName, lValue));
+ }
+ return lResult;
+}
=== added file 'bin/zorbacmdproperties.h'
--- bin/zorbacmdproperties.h 1970-01-01 00:00:00 +0000
+++ bin/zorbacmdproperties.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,125 @@
+/*
+ * 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.
+ */
+#ifndef ZORBA_CMD_PROPERTIES_H
+#define ZORBA_CMD_PROPERTIES_H
+
+#include <zorba/config.h>
+#include <zorba/item.h>
+
+#include "zorbacmdproperties_base.h"
+
+class ZorbaCMDProperties : public zorbacmd::ZorbaCMDPropertiesBase
+{
+public:
+ struct ExternalVariable
+ {
+ std::string var_name;
+ std::string var_value;
+ bool inline_file;
+ };
+
+ typedef std::vector<ExternalVariable> ExternalVars_t;
+
+
+ struct StaticContextOption
+ {
+ std::string clark_qname;
+ std::string value;
+ };
+
+ typedef std::vector<StaticContextOption> Options_t;
+
+ struct FullTextMapping
+ {
+ std::string uri;
+ std::string value;
+ };
+
+ typedef std::vector<FullTextMapping> FullText_t;
+
+ typedef std::vector<std::string> QueriesOrFiles_t;
+
+protected:
+ ExternalVars_t theExternalVars;
+ Options_t theStaticContextOptions;
+ FullText_t theStopWordsMapping;
+ FullText_t theThesaurusMapping;
+
+public:
+ ExternalVars_t::const_iterator
+ externalVarsBegin() const { return theExternalVars.begin(); }
+
+ ExternalVars_t::const_iterator
+ externalVarsEnd() const { return theExternalVars.end(); }
+
+ Options_t::const_iterator
+ optionsBegin() const { return theStaticContextOptions.begin(); }
+
+ Options_t::const_iterator
+ optionsEnd() const { return theStaticContextOptions.end(); }
+
+ FullText_t::const_iterator
+ stopWordsBegin() const { return theStopWordsMapping.begin(); }
+
+ FullText_t::const_iterator
+ stopWordsEnd() const { return theStopWordsMapping.end(); }
+
+ FullText_t::const_iterator
+ thesaurusBegin() const { return theThesaurusMapping.begin(); }
+
+ FullText_t::const_iterator
+ thesaurusEnd() const { return theThesaurusMapping.end(); }
+
+ QueriesOrFiles_t::const_iterator
+ queriesOrFilesBegin() const { return theQueriesOrFiles.begin(); }
+
+ QueriesOrFiles_t::const_iterator
+ queriesOrFilesEnd() const { return theQueriesOrFiles.end(); }
+
+ std::vector<std::pair<std::string,std::string> >
+ getSerializerParameters() const;
+
+ void
+ getModulePath(std::string&) const;
+
+ void
+ getURIPath(std::string&) const;
+
+ void
+ getLibPath(std::string&) const;
+
+ void
+ getJVMClassPath(std::string&) const;
+
+ bool isDebug(){ return theDebug; }
+
+ bool hasNoLogo(){ return theNoLogo; }
+
+ std::string getDebugHost(){ return theDebugHost; }
+
+ unsigned int getDebugPort(){ return theDebugPort; }
+
+ std::string check_args ();
+
+ void printHelp(std::ostream& os) const {
+ os << "Zorba XQuery Engine\n";
+ os << "Available options:\n";
+ os << get_help_msg ();
+ }
+
+ bool loadProperties(int argc, char* argv[]);
+};
+#endif
=== added file 'bin/zorbacmdproperties.txt'
--- bin/zorbacmdproperties.txt 1970-01-01 00:00:00 +0000
+++ bin/zorbacmdproperties.txt 2013-08-27 22:37:07 +0000
@@ -0,0 +1,40 @@
+("timing,t", "Print timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.")
+("output-file,o", po::value<std::string>(), "Write the result to the given file.")
+("serialization-parameter,z", po::value<std::vector<std::string> >(), "Set serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).")
+("serialize-html", "Serialize the result as HTML.")
+("serialize-text", "Serialize the result as Text.")
+("indent,i", "Indent output.")
+("print-query", "Print the queries.")
+("print-errors-as-xml,x", "Print the errors as XML.")
+("byte-order-mark", "Set the byte-order-mark for the serializer.")
+("omit-xml-declaration,r", "Omit the XML declaration from the result.")
+("base-uri", po::value<std::string>(), "Set the base URI property of the static context.")
+("boundary-space", po::value<std::string>(), "Set the boundary-space policy ('strip' or 'preserve') in the static context.")
+("default-collation", po::value<std::string>(), "Add the given collation and set the value of the default collation in the static context to the given collation.")
+("construction-mode", po::value<std::string>(), "Set the construction mode ('strip' or 'preserve') in the static context.")
+("ordering-mode", po::value<std::string>(), "Set the ordering mode ('ordered' or 'unordered') in the static context.")
+("multiple,m", po::value<unsigned long>()->default_value (1), "Execute the given queries multiple times.")
+("query,q", po::value<std::vector<std::string> >(&theQueriesOrFiles), "Query test or file URI (file://...)")
+("as-files,f", "Treat all -q arguments as file paths instead of URIs or inline queries.")
+("external-variable,e", po::value<std::vector<std::string> >(), "Provide the value for a variable given a file (name=file) or a value (name:=value)")
+("context-item", po::value<std::string> (), "Set the context item to the XML document in a given file.")
+("optimization-level", po::value<std::string>()->default_value("O1"), "Optimization level for the query compiler (O0, O1 or O2 - default: O1)")
+("lib-module,l", "Query compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.")
+("parse-only", "Stop after parsing the query.")
+("compile-only", "Only compile (don't execute)")
+("no-serializer", "Do not serialize (discard) result.")
+("debug,d", "Launch the Zorba debugger server and connect to a DBGP-enabled debugger client.")
+("debug-host,h", po::value<std::string>()->default_value("127.0.0.1"), "The host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1")
+("debug-port,p", po::value<unsigned int>()->default_value (28028), "The port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028")
+("no-logo", "Print no logo when starting.")
+("timeout", po::value<long>()->default_value(-1), "Specify a timeout in seconds. After the specified time, the execution of the query will be aborted.")
+("uri-path", po::value<std::string>(), "URI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.")
+("lib-path", po::value<std::string>(), "Library path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.")
+("module-path", po::value<std::string>(), "Path (list of directories) to add to both the URI and Library paths.")
+("classpath", po::value<std::string>(), "JVM classpath to be used by modules using Java implementations")
+("option", po::value<std::vector<std::string> >(), "Set an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value").
+("trailing-nl", "Output a trailing newline after the result of the query.")
+("stop-words", po::value<std::vector<std::string> >(), "Mapping specifying a stop-words URI to another.")
+("thesaurus", po::value<std::vector<std::string> >(), "Mapping specifying a thesaurus URI to another.")
+("compile-plan,c", "Output the query plan as binary.")
+("execute-plan", "Take a query plan as binary and execute it. Binary query plans can be generated using the --compile-plan option.")
=== added file 'bin/zorbacmdproperties_base.h'
--- bin/zorbacmdproperties_base.h 1970-01-01 00:00:00 +0000
+++ bin/zorbacmdproperties_base.h 2013-08-27 22:37:07 +0000
@@ -0,0 +1,524 @@
+/*
+ * 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.
+ */
+/* vim:set et sw=2 ts=2: */
+
+#include <string>
+#include <sstream>
+#include <zorba/config.h>
+#include <zorba/properties_base.h>
+#include <cstring>
+
+#ifndef ZORBACMD_ZORBACMDPROPERTIESBASE
+#define ZORBACMD_ZORBACMDPROPERTIESBASE
+namespace zorbacmd
+{
+
+class ZorbaCMDPropertiesBase : public ::zorba::PropertiesBase
+{
+protected:
+ const char** get_all_options () const
+ {
+ static const char* result [] = {
+ "--timing",
+#ifdef ZORBA_WITH_FILE_ACCESS
+ "--output-file",
+#endif /* ZORBA_WITH_FILE_ACCESS */
+ "--serialization-parameter",
+ "--serialize-html", "--serialize-text", "--indent", "--print-query",
+ "--print-errors-as-xml", "--byte-order-mark", "--omit-xml-declaration",
+ "--base-uri", "--boundary-space", "--default-collation",
+ "--construction-mode", "--ordering-mode", "--multiple", "--query",
+ "--as-files", "--external-variable", "--context-item",
+ "--optimization-level", "--lib-module", "--parse-only", "--compile-only",
+ "--no-serializer", "--debug", "--debug-host", "--debug-port", "--no-logo",
+ "--timeout", "--uri-path", "--lib-path", "--module-path", "--classpath",
+ "--option", "--trailing-nl", "--stop-words", "--thesaurus",
+ "--compile-plan", "--execute-plan", "--serialize-plan",
+ "--disable-http-resolution", NULL };
+ return result;
+ }
+
+ bool theTiming;
+#ifdef ZORBA_WITH_FILE_ACCESS
+ std::string theOutputFile;
+#endif /* ZORBA_WITH_FILE_ACCESS */
+ std::vector<std::string> theSerializationParameter;
+ bool theSerializeHtml;
+ bool theSerializeText;
+ bool theIndent;
+ bool thePrintQuery;
+ bool thePrintErrorsAsXml;
+ bool theByteOrderMark;
+ bool theOmitXmlDeclaration;
+ std::string theBaseUri;
+ std::string theBoundarySpace;
+ std::string theDefaultCollation;
+ std::string theConstructionMode;
+ std::string theOrderingMode;
+ unsigned long theMultiple;
+ std::vector<std::string> theQueriesOrFiles;
+ bool theAsFiles;
+ std::vector<std::string> theExternalVariable;
+ std::string theContextItem;
+ std::string theOptimizationLevel;
+ bool theLibModule;
+ bool theParseOnly;
+ bool theCompileOnly;
+ bool theNoSerializer;
+ bool theDebug;
+ std::string theDebugHost;
+ unsigned int theDebugPort;
+ bool theNoLogo;
+ long theTimeout;
+ std::string theUriPath;
+ std::string theLibPath;
+ std::string theModulePath;
+ std::string theClasspath;
+ std::vector<std::string> theOption;
+ bool theTrailingNl;
+ std::vector<std::string> theStopWords;
+ std::vector<std::string> theThesaurus;
+ bool theSerializePlan;
+ bool theSavePlan;
+ bool theLoadPlan;
+
+ void initialize ()
+ {
+ theTiming = false;
+ theSerializeHtml = false;
+ theSerializeText = false;
+ theIndent = false;
+ thePrintQuery = false;
+ thePrintErrorsAsXml = false;
+ theByteOrderMark = false;
+ theOmitXmlDeclaration = false;
+ theMultiple = 1;
+ theAsFiles = false;
+ theOptimizationLevel = "O1";
+ theLibModule = false;
+ theParseOnly = false;
+ theCompileOnly = false;
+ theNoSerializer = false;
+ theDebug = false;
+ theDebugHost = "127.0.0.1";
+ theDebugPort = 28028;
+ theNoLogo = false;
+ theTimeout = -1;
+ theTrailingNl = false;
+ theSerializePlan = false;
+ theSavePlan = false;
+ theLoadPlan = false;
+ }
+
+public:
+ const bool &timing () const { return theTiming; }
+#ifdef ZORBA_WITH_FILE_ACCESS
+ const std::string &outputFile () const { return theOutputFile; }
+#endif /* ZORBA_WITH_FILE_ACCESS */
+ const std::vector<std::string> &serializationParameter () const { return theSerializationParameter; }
+ const bool &serializeHtml () const { return theSerializeHtml; }
+ const bool &serializeText () const { return theSerializeText; }
+ const bool &indent () const { return theIndent; }
+ const bool &printQuery () const { return thePrintQuery; }
+ const bool &printErrorsAsXml () const { return thePrintErrorsAsXml; }
+ const bool &byteOrderMark () const { return theByteOrderMark; }
+ const bool &omitXmlDeclaration () const { return theOmitXmlDeclaration; }
+ const std::string &baseUri () const { return theBaseUri; }
+ const std::string &boundarySpace () const { return theBoundarySpace; }
+ const std::string &defaultCollation () const { return theDefaultCollation; }
+ const std::string &constructionMode () const { return theConstructionMode; }
+ const std::string &orderingMode () const { return theOrderingMode; }
+ const unsigned long &multiple () const { return theMultiple; }
+ const std::vector<std::string> &query () const { return theQueriesOrFiles; }
+ const bool &asFiles () const { return theAsFiles; }
+ const std::vector<std::string> &externalVariable () const { return theExternalVariable; }
+ const std::string &contextItem () const { return theContextItem; }
+ const std::string &optimizationLevel () const { return theOptimizationLevel; }
+ const bool &libModule () const { return theLibModule; }
+ const bool &parseOnly () const { return theParseOnly; }
+ const bool &compileOnly () const { return theCompileOnly; }
+ const bool &noSerializer () const { return theNoSerializer; }
+ const bool &debug () const { return theDebug; }
+ const std::string &debugHost () const { return theDebugHost; }
+ const unsigned int &debugPort () const { return theDebugPort; }
+ const bool &noLogo () const { return theNoLogo; }
+ const long &timeout () const { return theTimeout; }
+ const std::string &uriPath () const { return theUriPath; }
+ const std::string &libPath () const { return theLibPath; }
+ const std::string &modulePath () const { return theModulePath; }
+ const std::string &classpath () const { return theClasspath; }
+ const std::vector<std::string> &option () const { return theOption; }
+ const bool &trailingNl () const { return theTrailingNl; }
+ const std::vector<std::string> &stopWords () const { return theStopWords; }
+ const std::vector<std::string> &thesaurus () const { return theThesaurus; }
+ const bool& serializePlan () const { return theSerializePlan; }
+ const bool& loadPlan () const { return theLoadPlan; }
+ const bool& savePlan () const { return theSavePlan; }
+
+ std::string load_argv (int argc, const char **argv)
+ {
+ if (argv == NULL) return "";
+
+ std::string result;
+ for (++argv; *argv != NULL; ++argv)
+ {
+ if (strcmp (*argv, "--help") == 0 || strcmp (*argv, "-h") == 0)
+ return "!HELP";
+
+ else if (strcmp (*argv, "--version") == 0)
+ return "!VER";
+
+ else if (strcmp (*argv, "--timing") == 0 || strncmp (*argv, "-t", 2) == 0)
+ {
+ theTiming = true;
+ }
+#ifdef ZORBA_WITH_FILE_ACCESS
+ else if (strcmp (*argv, "--output-file") == 0 || strncmp (*argv, "-o", 2) == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --output-file option"; break; }
+ init_val (*argv, theOutputFile, d);
+ }
+#endif /* ZORBA_WITH_FILE_ACCESS */
+ else if (strcmp (*argv, "--serialization-parameter") == 0 || strncmp (*argv, "-z", 2) == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --serialization-parameter option"; break; }
+
+ init_val (*argv, theSerializationParameter, d);
+ }
+ else if (strcmp (*argv, "--serialize-html") == 0)
+ {
+ theSerializeHtml = true;
+ }
+ else if (strcmp (*argv, "--serialize-text") == 0)
+ {
+ theSerializeText = true;
+ }
+ else if (strcmp (*argv, "--indent") == 0 || strncmp (*argv, "-i", 2) == 0)
+ {
+ theIndent = true;
+ }
+ else if (strcmp (*argv, "--print-query") == 0)
+ {
+ thePrintQuery = true;
+ }
+ else if (strcmp (*argv, "--print-errors-as-xml") == 0 || strncmp (*argv, "-x", 2) == 0)
+ {
+ thePrintErrorsAsXml = true;
+ }
+ else if (strcmp (*argv, "--byte-order-mark") == 0)
+ {
+ theByteOrderMark = true;
+ }
+ else if (strcmp (*argv, "--omit-xml-declaration") == 0 || strncmp (*argv, "-r", 2) == 0)
+ {
+ theOmitXmlDeclaration = true;
+ }
+ else if (strcmp (*argv, "--base-uri") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --base-uri option"; break; }
+ init_val (*argv, theBaseUri, d);
+ }
+ else if (strcmp (*argv, "--boundary-space") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --boundary-space option"; break; }
+ init_val (*argv, theBoundarySpace, d);
+ }
+ else if (strcmp (*argv, "--default-collation") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --default-collation option"; break; }
+ init_val (*argv, theDefaultCollation, d);
+ }
+ else if (strcmp (*argv, "--construction-mode") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --construction-mode option"; break; }
+
+ init_val (*argv, theConstructionMode, d);
+ }
+ else if (strcmp (*argv, "--ordering-mode") == 0) {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --ordering-mode option"; break; }
+
+ init_val (*argv, theOrderingMode, d);
+ }
+ else if (strcmp (*argv, "--multiple") == 0 || strncmp (*argv, "-m", 2) == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL)
+ {
+ result = "No value given for --multiple option"; break;
+ }
+ init_val(*argv, theMultiple, d);
+ }
+ else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-q", 2) == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL)
+ {
+ result = "No value given for --query option"; break;
+ }
+ init_val (*argv, theQueriesOrFiles, d);
+ }
+ else if (strcmp (*argv, "--as-files") == 0 || strncmp (*argv, "-f", 2) == 0)
+ {
+ theAsFiles = true;
+ }
+ else if (strcmp (*argv, "--external-variable") == 0 || strncmp (*argv, "-e", 2) == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL)
+ {
+ result = "No value given for --external-variable option"; break;
+ }
+ init_val(*argv, theExternalVariable, d);
+ }
+ else if (strcmp (*argv, "--context-item") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL)
+ {
+ result = "No value given for --context-item option"; break;
+ }
+ init_val (*argv, theContextItem, d);
+ }
+ else if (strcmp (*argv, "--optimization-level") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL)
+ {
+ result = "No value given for --optimization-level option"; break;
+ }
+ init_val(*argv, theOptimizationLevel, d);
+ }
+ else if (strcmp (*argv, "--lib-module") == 0 || strncmp (*argv, "-l", 2) == 0)
+ {
+ theLibModule = true;
+ }
+ else if (strcmp (*argv, "--parse-only") == 0)
+ {
+ theParseOnly = true;
+ }
+ else if (strcmp (*argv, "--compile-only") == 0)
+ {
+ theCompileOnly = true;
+ }
+ else if (strcmp (*argv, "--no-serializer") == 0)
+ {
+ theNoSerializer = true;
+ }
+ else if (strcmp (*argv, "--debug") == 0 || strncmp (*argv, "-d", 2) == 0)
+ {
+ theDebug = true;
+ }
+ else if (strcmp (*argv, "--debug-host") == 0 || strncmp (*argv, "-h", 2) == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL)
+ {
+ result = "No value given for --debug-host option"; break;
+ }
+ init_val (*argv, theDebugHost, d);
+ }
+ else if (strcmp (*argv, "--debug-port") == 0 || strncmp (*argv, "-p", 2) == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL)
+ {
+ result = "No value given for --debug-port option"; break;
+ }
+ init_val (*argv, theDebugPort, d);
+ }
+ else if (strcmp (*argv, "--no-logo") == 0)
+ {
+ theNoLogo = true;
+ }
+ else if (strcmp (*argv, "--timeout") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --timeout option"; break; }
+ init_val (*argv, theTimeout, d);
+ }
+ else if (strcmp (*argv, "--uri-path") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --uri-path option"; break; }
+ init_val (*argv, theUriPath, d);
+ }
+ else if (strcmp (*argv, "--lib-path") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --lib-path option"; break; }
+ init_val (*argv, theLibPath, d);
+ }
+ else if (strcmp (*argv, "--module-path") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --module-path option"; break; }
+ init_val (*argv, theModulePath, d);
+ }
+ else if (strcmp (*argv, "--classpath") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --classpath option"; break; }
+
+ init_val (*argv, theClasspath, d);
+ }
+ else if (strcmp (*argv, "--option") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --option option"; break; }
+ init_val (*argv, theOption, d);
+ }
+ else if (strcmp (*argv, "--trailing-nl") == 0)
+ {
+ theTrailingNl = true;
+ }
+ else if (strcmp (*argv, "--stop-words") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --stop-words option"; break; }
+ init_val (*argv, theStopWords, d);
+ }
+ else if (strcmp (*argv, "--thesaurus") == 0)
+ {
+ int d = 2;
+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+ if (*argv == NULL) { result = "No value given for --thesaurus option"; break; }
+ init_val (*argv, theThesaurus, d);
+ }
+ else if (strcmp (*argv, "--serialize-plan") == 0 || strncmp (*argv, "-s", 2) == 0)
+ {
+ theSerializePlan = true;
+ }
+ else if (strcmp (*argv, "--compile-plan") == 0)
+ {
+ theSavePlan = true;
+ }
+ else if (strcmp (*argv, "--execute-plan") == 0)
+ {
+ theLoadPlan = true;
+ }
+ else if (strcmp (*argv, "--disable-http-resolution") == 0)
+ {
+ init_val ("{http://www.zorba-xquery.com/options/features}disable=http-uri-resolution",
+ theOption, 0);
+ }
+ else if (strcmp (*argv, "--") == 0)
+ {
+ copy_args (++argv);
+ break;
+ }
+ else if ((*argv) [0] == '-')
+ {
+ result = "unknown command line option "; result += *argv; break;
+ }
+ else
+ {
+ copy_args (argv);
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ const char *get_help_msg () const
+ {
+ return
+ "--timing, -t\nPrint timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.\n\n"
+ "--output-file, -o\nWrite the result to the given file.\n\n"
+ "--serialization-parameter, -z\nSet serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).\n\n"
+ "--serialize-html\nSerialize the result as HTML.\n\n"
+ "--serialize-text\nSerialize the result as Text.\n\n"
+ "--indent, -i\nIndent output.\n\n"
+ "--print-query\nPrint the queries.\n\n"
+ "--print-errors-as-xml, -x\nPrint the errors as XML.\n\n"
+ "--byte-order-mark\nSet the byte-order-mark for the serializer.\n\n"
+ "--omit-xml-declaration, -r\nOmit the XML declaration from the result.\n\n"
+ "--base-uri\nSet the base URI property of the static context.\n\n"
+ "--boundary-space\nSet the boundary-space policy ('strip' or 'preserve') in the static context.\n\n"
+ "--default-collation\nAdd the given collation and set the value of the default collation in the static context to the given collation.\n\n"
+ "--construction-mode\nSet the construction mode ('strip' or 'preserve') in the static context.\n\n"
+ "--ordering-mode\nSet the ordering mode ('ordered' or 'unordered') in the static context.\n\n"
+ "--multiple, -m\nExecute the given queries multiple times.\n\n"
+ "--query, -q\nQuery test or file URI (file://...)\n\n"
+ "--as-files, -f\nTreat all -q arguments as file paths instead of URIs or inline queries.\n\n"
+ "--external-variable, -e\nProvide the value for a variable given a file (name=file) or a value (name:=value)\n\n"
+ "--context-item\nSet the context item to the XML document in a given file.\n\n"
+ "--optimization-level\nOptimization level for the query compiler (O0, O1 or O2 - default: O1)\n\n"
+ "--lib-module, -l\nQuery compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.\n\n"
+ "--parse-only\nStop after parsing the query.\n\n"
+ "--compile-only\nOnly compile (don't execute)\n\n"
+ "--no-serializer\nDo not serialize (discard) result.\n\n"
+ "--debug, -d\nLaunch the Zorba debugger server and connect to a DBGP-enabled debugger client.\n\n"
+ "--debug-host, -h\nThe host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1\n\n"
+ "--debug-port, -p\nThe port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028\n\n"
+ "--no-logo\nPrint no logo when starting.\n\n"
+ "--timeout\nSpecify a timeout in seconds. After the specified time, the execution of the query will be aborted.\n\n"
+ "--uri-path\nURI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.\n\n"
+ "--lib-path\nLibrary path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.\n\n"
+ "--module-path\nPath (list of directories) to add to both the URI and Library paths.\n\n"
+ "--classpath\nJVM classpath to be used by modules using Java implementations\n\n"
+ "--option\nSet an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value\n\n"
+ "--trailing-nl\nOutput a trailing newline after the result of the query.\n\n"
+ "--stop-words\nMapping specifying a stop-words URI to another.\n\n"
+ "--thesaurus\nMapping specifying a thesaurus URI to another.\n\n"
+ "--serialize-plan, -s\nSerialize and then load the query execution plan.\n\n"
+ "--compile-plan,\nDo not execute the query; just compile it and save the execution plan in the file specified with the -o option.\n\n"
+ "--execute-plan\nDo not compile the query; instead load the execution plan from the file specified by the -f -q options, and execute the loaded plan.\n\n"
+ "--disable-http-resolution\nDo not use HTTP to resolve URIs\n\n"
+ ;
+ }
+
+ static const ZorbaCMDPropertiesBase *instance ()
+ {
+ static ZorbaCMDPropertiesBase result;
+ return &result;
+ }
+
+ ZorbaCMDPropertiesBase () { initialize (); }
+
+};
+
+} // namespaces
+
+#endif // ZORBACMD_ZORBACMDPROPERTIESBASE
=== added directory 'cmake_modules'
=== added file 'cmake_modules/AddSrcSubfolder.cmake'
--- cmake_modules/AddSrcSubfolder.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/AddSrcSubfolder.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,85 @@
+# 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.
+#
+# Adds source files from a subfolder to a list of sources. Works
+# recursively. It will also create source groups with files and headers
+# for use with MSVC.
+#
+# Syntax:
+#
+# ADD_SRC_SUBFOLDER(DESTINATION_SRCS SUBFOLDER SOURCES_LIST1 SOURCES_LIST2 ...)
+#
+# DESTINATION_SRCS - the list to which the sources in the subfolder will be added to
+# SUBFOLDER - the name of the subfolder
+# SOURCES_LISTx - the name of the list that contains the sources in the subfolder
+#
+
+
+MACRO (ADD_SRC_SUBFOLDER DESTINATION_SRCS SUBFOLDER ...)
+ GET_PATHS(${SUBFOLDER})
+
+ INCLUDE (${REL_PATH}/CMakeLists.txt) # side-effects!
+
+ GET_PATHS(${SUBFOLDER})
+
+ FILE (GLOB HEADER_FILES RELATIVE ${ABS_PATH}/${SUBFOLDER} ${REL_PATH}/*.h)
+ IF (NOT HEADER_FILES STREQUAL "")
+ SOURCE_GROUP (${SUBFOLDER} FILES ${SUBFOLDER}/${HEADER_FILES})
+ LIST (APPEND ${ARGV2} ${HEADER_FILES})
+ ENDIF (NOT HEADER_FILES STREQUAL "")
+
+
+ SET(SUB_SRCS_LIST ${ARGV2} ${ARGN})
+
+ FOREACH (SUB_SRCS ${SUB_SRCS_LIST})
+ FOREACH (SRCS ${${SUB_SRCS}})
+ SOURCE_GROUP (${SUBFOLDER} FILES ${SUBFOLDER}/${SRCS})
+ LIST(APPEND ${DESTINATION_SRCS} ${SUBFOLDER}/${SRCS})
+ ENDFOREACH (SRCS ${${SUB_SRCS}})
+ ENDFOREACH (SUB_SRCS ${SUB_SRCS_LIST})
+ENDMACRO (ADD_SRC_SUBFOLDER DESTINATION_SRCS SUBFOLDER ...)
+
+
+# Macro that sets the ABS_PATH and REL_PATH *globals*
+MACRO (GET_PATHS SUBFOLDER)
+ FILE(RELATIVE_PATH REL_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_LIST_FILE})
+ GET_FILENAME_COMPONENT(REL_PATH ${REL_PATH} PATH)
+ GET_FILENAME_COMPONENT(ABS_PATH ${CMAKE_CURRENT_LIST_FILE} PATH)
+
+ IF (REL_PATH STREQUAL "")
+ SET(REL_PATH ${SUBFOLDER})
+ ELSE (REL_PATH STREQUAL "")
+ SET(REL_PATH ${REL_PATH}/${SUBFOLDER})
+ ENDIF (REL_PATH STREQUAL "")
+ENDMACRO (GET_PATHS SUBFOLDER)
+
+
+# Prints out a CMake list
+MACRO(PRINT_LIST LIST)
+ FOREACH (ITEM ${${LIST}})
+ MESSAGE(${LIST} ": " ${ITEM})
+ ENDFOREACH (ITEM ${${LIST}})
+ENDMACRO(PRINT_LIST LIST)
+
+
+# Adds header files from the given subfolder to a SOURCE_GROUP, for use with MSVC
+MACRO (HEADER_GROUP_SUBFOLDER DESTINATION_SRCS SUBFOLDER)
+ GET_PATHS(${SUBFOLDER})
+ FILE (GLOB HEADER_FILES RELATIVE ${ABS_PATH} ${REL_PATH}/*.h)
+
+ IF (NOT HEADER_FILES STREQUAL "")
+ SOURCE_GROUP (${SUBFOLDER} FILES ${SUBFOLDER}/${HEADER_FILES})
+ LIST (APPEND ${DESTINATION_SRCS} ${HEADER_FILES})
+ ENDIF (NOT HEADER_FILES STREQUAL "")
+ENDMACRO (HEADER_GROUP_SUBFOLDER SUBFOLDER)
=== added file 'cmake_modules/CMakeCompareVersionStrings.cmake'
--- cmake_modules/CMakeCompareVersionStrings.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/CMakeCompareVersionStrings.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,84 @@
+# 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.
+#
+# Computes the realtionship between two version strings. A version
+# string is a number delineated by '.'s such as 1.3.2 and 0.99.9.1.
+# You can feed version strings with different number of dot versions,
+# and the shorter version number will be padded with zeros: 9.2 <
+# 9.2.1 will actually compare 9.2.0 < 9.2.1.
+#
+# Input: a_in - value, not variable
+# b_in - value, not variable
+# result_out - variable with value:
+# -1 : a_in < b_in
+# 0 : a_in == b_in
+# 1 : a_in > b_in
+#
+# Written by James Bigler.
+MACRO(COMPARE_VERSION_STRINGS a_in b_in result_out)
+ # Since SEPARATE_ARGUMENTS using ' ' as the separation token,
+ # replace '.' with ' ' to allow easy tokenization of the string.
+ STRING(REPLACE "." " " a "${a_in}")
+ STRING(REPLACE "." " " b "${b_in}")
+ SEPARATE_ARGUMENTS(a)
+ SEPARATE_ARGUMENTS(b)
+
+ # Check the size of each list to see if they are equal.
+ LIST(LENGTH a a_length)
+ LIST(LENGTH b b_length)
+
+ # Pad the shorter list with zeros.
+
+ # Note that range needs to be one less than the length as the for
+ # loop is inclusive (silly CMake).
+ IF(a_length LESS b_length)
+ # a is shorter
+ SET(shorter a)
+ MATH(EXPR range "${b_length} - 1")
+ MATH(EXPR pad_range "${b_length} - ${a_length} - 1")
+ ELSE(a_length LESS b_length)
+ # b is shorter
+ SET(shorter b)
+ MATH(EXPR range "${a_length} - 1")
+ MATH(EXPR pad_range "${a_length} - ${b_length} - 1")
+ ENDIF(a_length LESS b_length)
+
+ # PAD out if we need to
+ IF(NOT pad_range LESS 0)
+ FOREACH(pad RANGE ${pad_range})
+ # Since shorter is an alias for b, we need to get to it by by dereferencing shorter.
+ LIST(APPEND ${shorter} 0)
+ ENDFOREACH(pad RANGE ${pad_range})
+ ENDIF(NOT pad_range LESS 0)
+
+ SET(result 0)
+ FOREACH(index RANGE ${range})
+ IF(result EQUAL 0)
+ # Only continue to compare things as long as they are equal
+ LIST(GET a ${index} a_version)
+ LIST(GET b ${index} b_version)
+ # LESS
+ IF(a_version LESS b_version)
+ SET(result -1)
+ ENDIF(a_version LESS b_version)
+ # GREATER
+ IF(a_version GREATER b_version)
+ SET(result 1)
+ ENDIF(a_version GREATER b_version)
+ ENDIF(result EQUAL 0)
+ ENDFOREACH(index)
+
+ # Copy out the return result
+ SET(${result_out} ${result})
+ENDMACRO(COMPARE_VERSION_STRINGS)
=== added file 'cmake_modules/CMakeLists.txt'
--- cmake_modules/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ cmake_modules/CMakeLists.txt 2013-08-27 22:37:07 +0000
@@ -0,0 +1,25 @@
+# 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.
+
+INSTALL(FILES ZorbaModule.cmake DESTINATION "${ZORBA_CMAKE_DIR}")
+
+# Install Windows/ProxyFindModule.cmake for use of Module
+IF(WIN32)
+ INSTALL(FILES
+ "${CMAKE_CURRENT_SOURCE_DIR}/Windows/ProxyFindModule.cmake"
+ DESTINATION "${ZORBA_CMAKE_DIR}/Windows")
+ENDIF(WIN32)
+
+#creates file used for configuration of CPACK for external modules.
+FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeCPackModules.cmake)
\ No newline at end of file
=== added file 'cmake_modules/CMakeUseBison.cmake'
--- cmake_modules/CMakeUseBison.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/CMakeUseBison.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,105 @@
+# 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.
+#
+# - Look for GNU Bison, the parser generator
+# Defines the following:
+# BISON_EXECUTABLE - path to the bison executable
+# BISON_FILE - parse a file with bison
+# BISON_PREFIX_OUTPUTS - Set to true to make BISON_FILE produce prefixed
+# symbols in the generated output based on filename.
+# So for ${filename}.y, you'll get ${filename}parse(), etc.
+# instead of yyparse().
+# BISON_GENERATE_DEFINES - Set to true to make BISON_FILE output the matching
+# .h file for a .c file. You want this if you're using
+# flex.
+# BISON_VERSION - Returns the Bison version
+# BISON_MAJOR_VERSION - Returns the Bison major version
+# BISON_MINOR_VERSION - Returns the Bison minor version
+#
+
+
+IF(NOT DEFINED BISON_PREFIX_OUTPUTS)
+ SET(BISON_PREFIX_OUTPUTS FALSE)
+ENDIF(NOT DEFINED BISON_PREFIX_OUTPUTS)
+
+IF(NOT DEFINED BISON_GENERATE_DEFINES)
+ SET(BISON_GENERATE_DEFINES FALSE)
+ENDIF(NOT DEFINED BISON_GENERATE_DEFINES)
+
+IF(NOT BISON_EXECUTABLE)
+ MESSAGE(STATUS "Looking for bison")
+ FIND_PROGRAM(BISON_EXECUTABLE bison)
+ IF(BISON_EXECUTABLE)
+ EXEC_PROGRAM(
+ ${BISON_EXECUTABLE}
+ ARGS --version
+ OUTPUT_VARIABLE BISON_VERSION)
+
+ # Extract major and minor versions
+ STRING (REGEX REPLACE "[^0-9]*([0-9]+)..*" "\\1" BISON_MAJOR_VERSION_TMP ${BISON_VERSION})
+ STRING (REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+).*" "\\1" BISON_MINOR_VERSION_TMP ${BISON_VERSION})
+ MESSAGE(STATUS "Found bison -- ${BISON_EXECUTABLE}, version: " ${BISON_MAJOR_VERSION_TMP} "." ${BISON_MINOR_VERSION_TMP})
+ SET (BISON_MAJOR_VERSION ${BISON_MAJOR_VERSION_TMP} CACHE STRING "The Bison major version" FORCE)
+ SET (BISON_MINOR_VERSION ${BISON_MINOR_VERSION_TMP} CACHE STRING "The Bison minor version" FORCE)
+ ELSE (BISON_EXECUTABLE)
+ SET (BISON_MAJOR_VERSION "0")
+ SET (BISON_MINOR_VERSION "0")
+ ENDIF(BISON_EXECUTABLE)
+ SET (BISON_VERSION_FULL ${BISON_MAJOR_VERSION}.${BISON_MINOR_VERSION} CACHE STRING "The Bison version" FORCE)
+ENDIF(NOT BISON_EXECUTABLE)
+
+IF(BISON_EXECUTABLE)
+ MACRO(BISON_FILE FILENAME)
+ GET_FILENAME_COMPONENT(PATH "${FILENAME}" PATH)
+ GET_FILENAME_COMPONENT(HEAD "${FILENAME}" NAME_WE)
+ IF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${PATH}")
+ FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PATH}")
+ ENDIF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${PATH}")
+ IF(BISON_PREFIX_OUTPUTS)
+ SET(PREFIX "${HEAD}")
+ ELSE(BISON_PREFIX_OUTPUTS)
+ SET(PREFIX "yy")
+ ENDIF(BISON_PREFIX_OUTPUTS)
+ SET(OUTFILE "${CMAKE_CURRENT_BINARY_DIR}/${PATH}/${HEAD}.cpp")
+ IF(BISON_GENERATE_DEFINES)
+ SET(HEADER "${CMAKE_CURRENT_BINARY_DIR}/${PATH}/${HEAD}.hpp")
+ SET(LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${PATH}/location.hh")
+ SET(POSITION "${CMAKE_CURRENT_BINARY_DIR}/${PATH}/position.hh")
+ SET(STACK "${CMAKE_CURRENT_BINARY_DIR}/${PATH}/stack.hh")
+
+ ADD_CUSTOM_COMMAND(
+ OUTPUT "${OUTFILE}" "${HEADER}" "${LOCATION}" "${POSITION}" "${STACK}"
+ COMMAND "${BISON_EXECUTABLE}"
+ ARGS "--name-prefix=${PREFIX}"
+ "--defines"
+ "-t"
+ "-rall"
+ "--locations"
+ "--output-file=${OUTFILE}"
+ "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}"
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}")
+ SET_SOURCE_FILES_PROPERTIES("${OUTFILE}" "${HEADER}" "${LOCATION}" "${POSITION}" "${STACK}" PROPERTIES GENERATED TRUE)
+ SET_SOURCE_FILES_PROPERTIES("${HEADER}" "${LOCATION}" "${POSITION}" "${STACK}" PROPERTIES HEADER_FILE_ONLY TRUE)
+ ELSE(BISON_GENERATE_DEFINES)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT "${OUTFILE}"
+ COMMAND "${BISON_EXECUTABLE}"
+ ARGS "--name-prefix=${PREFIX}"
+ "--output-file=${OUTFILE}"
+ "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}"
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}")
+ SET_SOURCE_FILES_PROPERTIES("${OUTFILE}" PROPERTIES GENERATED TRUE)
+ ENDIF(BISON_GENERATE_DEFINES)
+ ENDMACRO(BISON_FILE)
+ENDIF(BISON_EXECUTABLE)
=== added file 'cmake_modules/CMakeUseDoxygen.cmake'
--- cmake_modules/CMakeUseDoxygen.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/CMakeUseDoxygen.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,170 @@
+# Copyright 2006-2011 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.
+#
+#
+#
+# -helper macro to add a "doc" target with CMake build system.
+# and configure doxy.config.in to doxy.config
+#
+# target "doc" allows building the documentation with doxygen/dot on WIN32 and Linux
+# Creates .chm windows help file if MS HTML help workshop
+# (available from http://msdn.microsoft.com/workshop/author/htmlhelp)
+# is installed with its DLLs in PATH.
+#
+#
+# Please note, that the tools, e.g.:
+# doxygen, dot, latex, dvips, makeindex, gswin32, etc.
+# must be in path.
+#
+# Note about Visual Studio Projects:
+# MSVS hast its own path environment which may differ from the shell.
+# See "Menu Tools/Options/Projects/VC++ Directories" in VS 7.1
+#
+# author Jan Woetzel 2004-2006
+# www.mip.informatik.uni-kiel.de/~jw
+
+MACRO (ZORBA_DOXYGEN DOXYGEN_SOURCE DOXYGEN_BINARY DOXYGEN_TARGET_NAME)
+ IF (DOXYGEN_FOUND)
+ # the FindDoxygen module doesn't set DOXYGEN_DOT_FOUND like it is
+ # supposed to, so here we have a workaround.
+ IF (DOXYGEN_DOT_EXECUTABLE)
+
+ FIND_PROGRAM(DOXYGEN_DOT_EXECUTABLE_PATH
+ NAMES dot
+ PATHS
+ "$ENV{ProgramFiles}/Graphviz 2.21/bin"
+ "C:/Program Files/Graphviz 2.21/bin"
+ "$ENV{ProgramFiles}/ATT/Graphviz/bin"
+ "C:/Program Files/ATT/Graphviz/bin"
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin
+ /Applications/Graphviz.app/Contents/MacOS
+ /Applications/Doxygen.app/Contents/Resources
+ /Applications/Doxygen.app/Contents/MacOS
+ DOC "Graphviz Dot tool for using Doxygen"
+ )
+
+ SET(DOXYGEN_DOT_FOUND "YES")
+ # The Doxyfile wants the path to Dot, not the entire path and executable
+ GET_FILENAME_COMPONENT(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH CACHE)
+
+ ENDIF (DOXYGEN_DOT_EXECUTABLE)
+
+ # click+jump in Emacs and Visual Studio (for doxy.config) (jw)
+ IF (CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
+ SET(DOXY_WARN_FORMAT "\"$file($line) : $text \"")
+ ELSE (CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
+ SET(DOXY_WARN_FORMAT "\"$file:$line: $text \"")
+ ENDIF (CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
+
+ # we need latex for doxygen because of the formulas
+ FIND_PACKAGE (LATEX)
+ IF (NOT LATEX_COMPILER)
+ MESSAGE(STATUS "latex command LATEX_COMPILER not found but usually required. You will probably get warnings and user inetraction on doxy run.")
+ ENDIF (NOT LATEX_COMPILER)
+ IF (NOT MAKEINDEX_COMPILER)
+ MESSAGE (STATUS "makeindex command MAKEINDEX_COMPILER not found but usually required.")
+ ENDIF (NOT MAKEINDEX_COMPILER)
+ IF (NOT DVIPS_CONVERTER)
+ MESSAGE (STATUS "dvips command DVIPS_CONVERTER not found but usually required.")
+ ENDIF (NOT DVIPS_CONVERTER)
+
+ IF (EXISTS "${DOXYGEN_SOURCE}/doxy.config.in")
+ MESSAGE (STATUS "configured ${DOXYGEN_SOURCE}/doxy.config.in --> ${DOXYGEN_BINARY}/doxy.config")
+ CONFIGURE_FILE (
+ ${DOXYGEN_SOURCE}/doxy.config.in
+ ${DOXYGEN_BINARY}/doxy.config
+ @ONLY
+ )
+ # use (configured) doxy.config from (out of place) BUILD tree:
+ SET (DOXY_CONFIG "${DOXYGEN_BINARY}/doxy.config")
+ ELSE (EXISTS "${DOXYGEN_SOURCE}/doxy.config.in")
+ # use static hand-edited doxy.config from SOURCE tree:
+ SET (DOXY_CONFIG "${DOXYGEN_SOURCE}/doxy.config")
+ IF (EXISTS "${DOXYGEN_SOURCE}/doxy.config")
+ MESSAGE (STATUS "WARNING: using existing ${DOXYGEN_SOURCE}/doxy.config instead of configuring from doxy.config.in file.")
+ ELSE (EXISTS "${DOXYGEN_SOURCE}/doxy.config")
+ IF (EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
+ # using template doxy.config.in
+ MESSAGE (STATUS "configured ${CMAKE_CMAKE_MODULE_PATH}/doxy.config.in --> ${DOXYGEN_BINARY}/doxy.config")
+ CONFIGURE_FILE (
+ ${CMAKE_MODULE_PATH}/doxy.config.in
+ ${DOXYGEN_BINARY}/doxy.config
+ @ONLY
+ )
+ SET (DOXY_CONFIG "${DOXYGEN_BINARY}/doxy.config")
+ ELSE (EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
+ # failed completely...
+ MESSAGE (SEND_ERROR "Please create ${DOXYGEN_SOURCE}/doxy.config.in (or doxy.config as fallback)")
+ ENDIF (EXISTS "${CMAKE_MODULE_PATH}/doxy.config.in")
+
+ ENDIF (EXISTS "${DOXYGEN_SOURCE}/doxy.config")
+ ENDIF (EXISTS "${DOXYGEN_SOURCE}/doxy.config.in")
+
+ SET (DOXY_CONFIG_NATIVE)
+ FILE (TO_NATIVE_PATH ${DOXY_CONFIG} DOXY_CONFIG_NATIVE)
+ ADD_CUSTOM_TARGET (${DOXYGEN_TARGET_NAME} "${DOXYGEN_EXECUTABLE}" "${DOXY_CONFIG_NATIVE}")
+ SET_TARGET_PROPERTIES(${DOXYGEN_TARGET_NAME} PROPERTIES
+ FOLDER "Docs"
+ )
+
+ # create a windows help .chm file using hhc.exe
+ # HTMLHelp DLL must be in path!
+ # fallback: use hhw.exe interactively
+ IF (WIN32)
+ FIND_PACKAGE (HTMLHelp)
+ IF (HTML_HELP_COMPILER)
+ SET (TMP "${DOXYGEN_BINARY}\\Doc\\html\\index.hhp")
+ STRING (REGEX REPLACE "[/]" "\\\\" HHP_FILE ${TMP} )
+ ADD_CUSTOM_TARGET (winhelp_${DOXYGEN_TARGET_NAME} ${HTML_HELP_COMPILER} ${HHP_FILE})
+ ADD_DEPENDENCIES (winhelp_${DOXYGEN_TARGET_NAME} ${DOXYGEN_TARGET_NAME})
+ SET_TARGET_PROPERTIES(winhelp_${DOXYGEN_TARGET_NAME} PROPERTIES
+ FOLDER "Docs"
+ )
+
+ IF (NOT TARGET_DOC_SKIP_INSTALL)
+ # install windows help?
+ # determine useful name for output file
+ # should be project and version unique to allow installing
+ # multiple projects into one global directory
+ IF (EXISTS "${PROJECT_BINARY_DIR}/Doc/html/index.chm")
+ IF (PROJECT_NAME)
+ SET (OUT "${PROJECT_NAME}")
+ ELSE (PROJECT_NAME)
+ SET (OUT "Documentation") # default
+ ENDIF (PROJECT_NAME)
+ IF (${PROJECT_NAME}_VERSION_MAJOR)
+ SET (OUT "${OUT}-${${PROJECT_NAME}_VERSION_MAJOR}")
+ IF (${PROJECT_NAME}_VERSION_MINOR)
+ SET (OUT "${OUT}.${${PROJECT_NAME}_VERSION_MINOR}")
+ IF (${PROJECT_NAME}_VERSION_PATCH)
+ SET(OUT "${OUT}.${${PROJECT_NAME}_VERSION_PATCH}")
+ ENDIF (${PROJECT_NAME}_VERSION_PATCH)
+ ENDIF (${PROJECT_NAME}_VERSION_MINOR)
+ ENDIF (${PROJECT_NAME}_VERSION_MAJOR)
+ # keep suffix
+ SET (OUT "${OUT}.chm")
+
+ # create target used by install and package commands
+ INSTALL (
+ FILES "${PROJECT_BINARY_DIR}/Doc/html/index.chm"
+ DESTINATION "doc"
+ RENAME "${OUT}"
+ )
+ ENDIF (EXISTS "${PROJECT_BINARY_DIR}/Doc/html/index.chm")
+ ENDIF (NOT TARGET_DOC_SKIP_INSTALL)
+
+ ENDIF (HTML_HELP_COMPILER)
+ ENDIF (WIN32)
+ ENDIF (DOXYGEN_FOUND)
+ENDMACRO (ZORBA_DOXYGEN)
=== added file 'cmake_modules/CMakeUseFlex.cmake'
--- cmake_modules/CMakeUseFlex.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/CMakeUseFlex.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,95 @@
+# 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.
+#
+# - Look for GNU flex, the lexer generator.
+# Defines the following:
+# FLEX_EXECUTABLE - path to the flex executable
+# FLEX_FILE - parse a file with flex
+# FLEX_PREFIX_OUTPUTS - Set to true to make FLEX_FILE produce outputs of
+# ${filename}.cpp, not lex.yy.c . Passes -P to flex.
+# FLEX_MAJOR_VERSION
+# FLEX_MINOR_VERSION
+# FLEX_REVISION_VERSION - Return the flex version
+#
+
+IF(NOT DEFINED FLEX_PREFIX_OUTPUTS)
+ SET(FLEX_PREFIX_OUTPUTS FALSE)
+ENDIF(NOT DEFINED FLEX_PREFIX_OUTPUTS)
+
+IF(NOT FLEX_EXECUTABLE)
+ MESSAGE(STATUS "Looking for flex")
+ FIND_PROGRAM(FLEX_EXECUTABLE flex)
+ IF(FLEX_EXECUTABLE)
+ EXEC_PROGRAM(
+ ${FLEX_EXECUTABLE}
+ ARGS --version
+ OUTPUT_VARIABLE FLEX_VERSION)
+
+ # Extract major and minor versions
+ STRING (REGEX REPLACE "[^0-9]*([0-9]+)..*" "\\1" FLEX_MAJOR_VERSION_TMP ${FLEX_VERSION})
+ STRING (REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+).*" "\\1" FLEX_MINOR_VERSION_TMP ${FLEX_VERSION})
+ STRING (REGEX REPLACE "[^0-9]*[0-9]+\\.[0-9]+\\.([0-9]+[a-z]*).*" "\\1" FLEX_REVISION_VERSION_TMP ${FLEX_VERSION})
+ MESSAGE(STATUS "Found flex -- ${FLEX_EXECUTABLE}, version: " ${FLEX_MAJOR_VERSION_TMP} "." ${FLEX_MINOR_VERSION_TMP} "." ${FLEX_REVISION_VERSION_TMP})
+ SET (FLEX_MAJOR_VERSION ${FLEX_MAJOR_VERSION_TMP} CACHE STRING "The flex major version" FORCE)
+ SET (FLEX_MINOR_VERSION ${FLEX_MINOR_VERSION_TMP} CACHE STRING "The flex minor version" FORCE)
+ SET (FLEX_REVISION_VERSION ${FLEX_REVISION_VERSION_TMP} CACHE STRING "The flex revision version" FORCE)
+
+ # Find the FlexLexer.h header. Try our best to find the one associated
+ # with the flex binary we're actually using.
+ GET_FILENAME_COMPONENT(_flex_path "${FLEX_EXECUTABLE}" PATH)
+ GET_FILENAME_COMPONENT(_flex_hint "${_flex_path}/../include" ABSOLUTE)
+ FIND_PATH(FLEX_INCLUDE_DIR FlexLexer.h HINTS "${_flex_hint}")
+
+ ELSE (FLEX_EXECUTABLE)
+ SET (FLEX_MAJOR_VERSION "0")
+ SET (FLEX_MINOR_VERSION "0")
+ SET (FLEX_REVISION_VERSION "0")
+ ENDIF(FLEX_EXECUTABLE)
+ SET (FLEX_VERSION_FULL ${FLEX_MAJOR_VERSION}.${FLEX_MINOR_VERSION}.${FLEX_REVISION_VERSION} CACHE STRING "The Flex version" FORCE)
+ENDIF(NOT FLEX_EXECUTABLE)
+
+IF(FLEX_EXECUTABLE)
+ MACRO(FLEX_FILE FILENAME)
+ GET_FILENAME_COMPONENT(PATH "${FILENAME}" PATH)
+ IF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${PATH}")
+ FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PATH}")
+ ENDIF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${PATH}")
+ IF(FLEX_PREFIX_OUTPUTS)
+ GET_FILENAME_COMPONENT(PREFIX "${FILENAME}" NAME_WE)
+ ELSE(FLEX_PREFIX_OUTPUTS)
+ SET(PREFIX "yy")
+ ENDIF(FLEX_PREFIX_OUTPUTS)
+ # If we regenerate the scanner, be sure to copy the corresponding
+ # FlexLexer.h as well. Put it in the top-level src/ directory since
+ # that path is on the include-directories list; also, that way
+ # multiple flex'd files will all share the include file.
+ SET(FLEXLEXERH "${CMAKE_CURRENT_BINARY_DIR}/FlexLexer.h")
+ ADD_CUSTOM_COMMAND(
+ OUTPUT "${FLEXLEXERH}"
+ COMMAND "${CMAKE_COMMAND}"
+ ARGS -E copy_if_different
+ "${FLEX_INCLUDE_DIR}/FlexLexer.h"
+ "${FLEXLEXERH}")
+ SET(OUTFILE "${CMAKE_CURRENT_BINARY_DIR}/${PATH}/${PREFIX}.cpp")
+ ADD_CUSTOM_COMMAND(
+ OUTPUT "${OUTFILE}"
+ COMMAND "${FLEX_EXECUTABLE}"
+ ARGS -t --debug "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}"
+ # flex's --outfile doesn't seem to work right, so redirect stdout
+ > "${OUTFILE}"
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}"
+ "${FLEXLEXERH}")
+ SET_SOURCE_FILES_PROPERTIES("${OUTFILE}" PROPERTIES GENERATED TRUE)
+ ENDMACRO(FLEX_FILE)
+ENDIF(FLEX_EXECUTABLE)
=== added file 'cmake_modules/FindBoost.cmake'
--- cmake_modules/FindBoost.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindBoost.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,589 @@
+# - Try to find Boost include dirs and libraries
+# Usage of this module as follows:
+#
+# SET(Boost_USE_STATIC_LIBS ON)
+# SET(Boost_USE_MULTITHREAD OFF)
+# FIND_PACKAGE( Boost 1.34.1 COMPONENTS date_time filesystem iostreams ... )
+#
+# The Boost_ADDITIONAL_VERSIONS variable can be used to specify a list of
+# boost version numbers that should be taken into account when searching
+# for the libraries. Unfortunately boost puts the version number into the
+# actual filename for the libraries, so this might be needed in the future
+# when new boost versions are released.
+#
+# Currently this module searches for the following version numbers:
+# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0
+#
+# The components list needs to be the actual names of boost libraries, that is
+# the part of the actual library files that differ on different libraries. So
+# its "date_time" for "libboost_date_time...". Anything else will result in
+# errors
+#
+# You can provide a minimum version number that should be used. If you provide this
+# version number and specify the REQUIRED attribute, this module will fail if it
+# can't find the specified or a later version. If you specify a version number this is
+# automatically put into the considered list of version numbers and thus doesn't need
+# to be specified in the Boost_ADDITIONAL_VERSIONS variable
+#
+# Variables used by this module, they can change the default behaviour and need to be set
+# before calling find_package:
+# Boost_USE_MULTITHREAD Can be set to OFF to use the non-multithreaded
+# boost libraries. Defaults to ON.
+# Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static
+# boost libraries. Defaults to OFF.
+# Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching
+# the boost include directory. The default list
+# of version numbers is:
+# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0
+# If you want to look for an older or newer
+# version set this variable to a list of
+# strings, where each string contains a number, i.e.
+# SET(Boost_ADDITIONAL_VERSIONS "0.99.0" "1.35.0")
+# BOOST_ROOT Preferred installation prefix for searching for Boost,
+# set this if the module has problems finding the proper Boost installation
+# BOOST_INCLUDEDIR Set this to the include directory of Boost, if the
+# module has problems finding the proper Boost installation
+# BOOST_LIBRARYDIR Set this to the lib directory of Boost, if the
+# module has problems finding the proper Boost installation
+#
+# The last three variables are available also as environment variables
+#
+#
+# Variables defined by this module:
+#
+# Boost_FOUND System has Boost, this means the include dir was found,
+# as well as all the libraries specified in the COMPONENTS list
+# Boost_INCLUDE_DIRS Boost include directories, not cached
+# Boost_INCLUDE_DIR This is almost the same as above, but this one is cached and may be
+# modified by advanced users
+# Boost_LIBRARIES Link these to use the Boost libraries that you specified, not cached
+# Boost_LIBRARY_DIRS The path to where the Boost library files are.
+# Boost_VERSION The version number of the boost libraries that have been found,
+# same as in version.hpp from Boost
+# Boost_LIB_VERSION The version number in filename form as its appended to the library filenames
+# Boost_MAJOR_VERSION major version number of boost
+# Boost_MINOR_VERSION minor version number of boost
+# Boost_SUBMINOR_VERSION subminor version number of boost
+# Boost_LIB_DIAGNOSTIC_DEFINITIONS Only set on windows. Can be used with add_definitions
+# to print diagnostic information about the automatic
+# linking done on windows.
+
+# For each component you list the following variables are set.
+# ATTENTION: The component names need to be in lower case, just as the boost
+# library names however the cmake variables use upper case for the component
+# part. So you'd get Boost_SERIALIZATION_FOUND for example.
+#
+# Boost_${COMPONENT}_FOUND True IF the Boost library "component" was found.
+# Boost_${COMPONENT}_LIBRARY The absolute path of the Boost library "component".
+# Boost_${COMPONENT}_LIBRARY_DEBUG The absolute path of the debug version of the
+# Boost library "component".
+# Boost_${COMPONENT}_LIBRARY_RELEASE The absolute path of the release version of the
+# Boost library "component"
+#
+# Copyright (c) 2006-2008 Andreas Schneider <mail@xxxxxxxxxxxx>
+# Copyright (c) 2007 Wengo
+# Copyright (c) 2007 Mike Jackson
+# Copyright (c) 2008 Andreas Pakulat <apaku@xxxxxx>
+#
+# Redistribution AND use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+# this module required CMake 2.5 for the Boost_FIND_VERSION stuff
+# CMAKE_MINIMUM_REQUIRED(VERSION "2.6" FATAL_ERROR) #todo
+
+#MESSAGE(STATUS "Finding Boost libraries.... ")
+
+OPTION(Boost_USE_MULTITHREADED "Use the multithreaded versions of the boost libraries" ON)
+
+SET( _boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS} "1.35.0" "1.35" "1.34.1" "1.34.0" "1.34" "1.33.1" "1.33.0" "1.33" )
+
+
+############################################
+#
+# Check the existence of the libraries.
+#
+############################################
+# This macro was taken directly from the FindQt4.cmake file that is included
+# with the CMake distribution. This is NOT my work. All work was done by the
+# original authors of the FindQt4.cmake file. Only minor modifications were
+# made to remove references to Qt and make this file more generally applicable
+#########################################################################
+
+MACRO (_Boost_ADJUST_LIB_VARS basename)
+ IF (Boost_INCLUDE_DIR )
+ MESSAGE(STATUS "Adjusting ${basename} ")
+
+ IF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
+ MESSAGE(STATUS "found both release and debug version")
+ # 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(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_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(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
+ ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
+ ENDIF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
+
+ # if only the release version was found, set the debug variable also to the release version
+ IF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
+ MESSAGE(STATUS "only release version found")
+ SET(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE})
+ SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE})
+ SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE})
+ ENDIF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
+
+ # if only the debug version was found, set the release variable also to the debug version
+ IF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
+ MESSAGE(STATUS "only debug version found")
+ SET(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG})
+ SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG})
+ SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG})
+ ENDIF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
+
+ IF (Boost_${basename}_LIBRARY)
+ SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library")
+ GET_FILENAME_COMPONENT(Boost_LIBRARY_DIRS "${Boost_${basename}_LIBRARY}" PATH)
+ SET(Boost_${basename}_FOUND ON CACHE BOOL "Was the boost boost ${basename} library found")
+ MESSAGE(STATUS "Boost component library found ${basename}")
+ ENDIF (Boost_${basename}_LIBRARY)
+
+ ENDIF (Boost_INCLUDE_DIR )
+ # Make variables changeble to the advanced user
+ MARK_AS_ADVANCED(
+ Boost_${basename}_LIBRARY
+ Boost_${basename}_LIBRARY_RELEASE
+ Boost_${basename}_LIBRARY_DEBUG
+ )
+ENDMACRO (_Boost_ADJUST_LIB_VARS)
+
+#-------------------------------------------------------------------------------
+
+
+SET( _boost_IN_CACHE TRUE)
+IF(Boost_INCLUDE_DIR)
+ FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
+ STRING(TOUPPER ${COMPONENT} COMPONENT)
+ IF(NOT Boost_${COMPONENT}_FOUND)
+ SET( _boost_IN_CACHE FALSE)
+ ENDIF(NOT Boost_${COMPONENT}_FOUND)
+ ENDFOREACH(COMPONENT)
+ELSE(Boost_INCLUDE_DIR)
+ SET( _boost_IN_CACHE FALSE)
+ENDIF(Boost_INCLUDE_DIR)
+
+IF (_boost_IN_CACHE)
+ # in cache already
+ SET(Boost_FOUND TRUE)
+ FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
+ STRING(TOUPPER ${COMPONENT} COMPONENT)
+ _Boost_ADJUST_LIB_VARS( ${COMPONENT} )
+ SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY})
+ ENDFOREACH(COMPONENT)
+ SET(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
+ IF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
+ MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
+ MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
+ MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
+ ENDIF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
+ELSE (_boost_IN_CACHE)
+ # Need to search for boost
+
+ IF(WIN32)
+ # In windows, automatic linking is performed, so you do not have to specify the libraries.
+ # If you are linking to a dynamic runtime, then you can choose to link to either a static or a
+ # dynamic Boost library, the default is to do a static link. You can alter this for a specific
+ # library "whatever" by defining BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to
+ # be linked dynamically. Alternatively you can force all Boost libraries to dynamic link by
+ # defining BOOST_ALL_DYN_LINK.
+
+ # This feature can be disabled for Boost library "whatever" by defining BOOST_WHATEVER_NO_LIB,
+ # or for all of Boost by defining BOOST_ALL_NO_LIB.
+
+ # If you want to observe which libraries are being linked against then defining
+ # BOOST_LIB_DIAGNOSTIC will cause the auto-linking code to emit a #pragma message each time
+ # a library is selected for linking.
+ SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
+ ENDIF(WIN32)
+
+
+ SET(_boost_INCLUDE_SEARCH_DIRS
+ C:/boost/include
+ "C:/Program Files/boost/boost_${Boost_MINIMUM_VERSION}"
+ # D: is very often the cdrom drive, IF you don't have a
+ # cdrom inserted it will popup a very annoying dialog
+ #D:/boost/include
+ /sw/local/include
+ )
+
+ SET(_boost_LIBRARIES_SEARCH_DIRS
+ C:/boost/lib
+ "C:/Program Files/boost/boost_${Boost_MINIMUM_VERSION}/lib"
+ /sw/local/lib
+ )
+
+ IF( NOT $ENV{BOOST_ROOT} STREQUAL "" )
+ SET(_boost_INCLUDE_SEARCH_DIRS $ENV{BOOST_ROOT}/include ${_boost_INCLUDE_SEARCH_DIRS})
+ SET(_boost_LIBRARIES_SEARCH_DIRS $ENV{BOOST_ROOT}/lib ${_boost_INCLUDE_SEARCH_DIRS})
+ ENDIF( NOT $ENV{BOOST_ROOT} STREQUAL "" )
+
+ IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
+ SET(_boost_INCLUDE_SEARCH_DIRS $ENV{BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
+ ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
+
+ IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
+ SET(_boost_LIBRARIES_SEARCH_DIRS $ENV{BOOST_LIBRARYDIR} ${_boost_INCLUDE_SEARCH_DIRS})
+ ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
+
+ IF( BOOST_ROOT )
+ IF (WIN32 OR CYGWIN)
+ SET(_boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT} ${_boost_INCLUDE_SEARCH_DIRS})
+ SET(_boost_LIBRARIES_SEARCH_DIRS ${BOOST_ROOT}/lib ${_boost_LIBRARIES_SEARCH_DIRS})
+ ELSE (WIN32 OR CYGWIN)
+ SET(_boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT}/include ${_boost_INCLUDE_SEARCH_DIRS})
+ SET(_boost_LIBRARIES_SEARCH_DIRS ${BOOST_ROOT}/lib ${_boost_LIBRARIES_SEARCH_DIRS})
+ ENDIF (WIN32 OR CYGWIN)
+ ENDIF( BOOST_ROOT )
+
+ IF( BOOST_INCLUDEDIR )
+ IF (WIN32)
+ SET(_boost_INCLUDE_SEARCH_DIRS ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
+ ELSE (WIN32)
+ SET(_boost_INCLUDE_SEARCH_DIRS ${BOOST_INCLUDEDIR}/include ${_boost_INCLUDE_SEARCH_DIRS})
+ ENDIF (WIN32)
+ ENDIF( BOOST_INCLUDEDIR )
+
+ IF( BOOST_LIBRARYDIR )
+ IF (WIN32)
+ SET(_boost_LIBRARIES_SEARCH_DIRS ${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS})
+ ELSE (WIN32)
+ SET(_boost_LIBRARIES_SEARCH_DIRS ${BOOST_LIBRARYDIR}/include ${_boost_LIBRARIES_SEARCH_DIRS})
+ ENDIF (WIN32)
+ ENDIF( BOOST_LIBRARYDIR )
+
+ MESSAGE(STATUS "Boost_INCLUDE_DIR = ${Boost_INCLUDE_DIR}" )
+ #Try first in our own include search paths (e.g. BOOST_ROOT)
+ FOREACH(_boost_VER ${_boost_TEST_VERSIONS})
+ IF( NOT Boost_INCLUDE_DIR )
+
+ # Add in a path suffix, based on the required version, ideally we could
+ # read this from version.hpp, but for that to work we'd need to know the include
+ # dir already
+ SET(_boost_PATH_SUFFIX
+ boost-${_boost_VER}
+ )
+ MESSAGE(STATUS "try _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX}" )
+
+ IF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
+ STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3" _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
+ ELSEIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+")
+ STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2" _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
+ ENDIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
+
+
+ FIND_PATH(Boost_INCLUDE_DIR
+ NAMES boost/config.hpp
+ PATHS ${_boost_INCLUDE_SEARCH_DIRS}
+ PATH_SUFFIXES ${_boost_PATH_SUFFIX}
+ NO_DEFAULT_PATH
+ )
+
+ ENDIF( NOT Boost_INCLUDE_DIR )
+ ENDFOREACH(_boost_VER)
+
+ # If nothing is found search again using system default paths
+ FOREACH(_boost_VER ${_boost_TEST_VERSIONS})
+ IF( NOT Boost_INCLUDE_DIR )
+
+ # Add in a path suffix, based on the required version, ideally we could
+ # read this from version.hpp, but for that to work we'd need to know the include
+ # dir already
+ SET(_boost_PATH_SUFFIX
+ boost-${_boost_VER}
+ )
+
+ IF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
+ STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3" _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
+ ELSEIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+")
+ STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2" _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
+ ENDIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
+
+ FIND_PATH(Boost_INCLUDE_DIR
+ NAMES boost/config.hpp
+ PATH_SUFFIXES ${_boost_PATH_SUFFIX}
+ )
+
+ ENDIF( NOT Boost_INCLUDE_DIR )
+ ENDFOREACH(_boost_VER)
+ IF(Boost_INCLUDE_DIR)
+ # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp
+ # Read the whole file:
+ #
+ SET(BOOST_VERSION 0)
+ SET(BOOST_LIB_VERSION "")
+ FILE(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS)
+
+ STRING(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}")
+ STRING(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}")
+
+ SET(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE STRING "The library version string for boost libraries")
+ SET(Boost_VERSION ${Boost_VERSION} CACHE STRING "The version number for boost libraries")
+
+ IF(NOT "${Boost_VERSION}" STREQUAL "0")
+ MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
+ MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
+ MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
+
+ ENDIF(NOT "${Boost_VERSION}" STREQUAL "0")
+
+ MESSAGE(STATUS "Found one boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} " )
+ ENDIF(Boost_INCLUDE_DIR)
+
+ #MESSAGE(STATUS "Boost_FIND_VERSION_MAJOR=${Boost_FIND_VERSION_MAJOR}")
+ #MESSAGE(STATUS "required Boost_VERSION_MAJOR=${Boost_VERSION_MAJOR}")
+ #MESSAGE(STATUS "Boost_FIND_VERSION_MINOR=${Boost_FIND_VERSION_MINOR} ")
+ #MESSAGE(STATUS "required Boost_VERSION_MINOR=${Boost_VERSION_MINOR}")
+
+ #Setting some more suffixes for the library
+ SET (Boost_LIB_PREFIX "")
+ IF ( WIN32 AND NOT CYGWIN)
+ SET (Boost_LIB_PREFIX "lib")
+ ENDIF ( WIN32 AND NOT CYGWIN )
+ SET (_boost_COMPILER "-gcc")
+ IF (MSVC71)
+ SET (_boost_COMPILER "-vc71")
+ ENDIF(MSVC71)
+ IF (MSVC80)
+ SET (_boost_COMPILER "-vc80")
+ ENDIF(MSVC80)
+ IF (MSVC90)
+ SET (_boost_COMPILER "-vc90")
+ ENDIF (MSVC90)
+ IF (MINGW)
+ SET (_boost_COMPILER "-mgw")
+ ENDIF(MINGW)
+ IF (CYGWIN)
+ SET (_boost_COMPILER "-gcc")
+ ENDIF (CYGWIN)
+ IF (UNIX)
+ IF (APPLE)
+ SET (_boost_COMPILER "")
+ ELSE (APPLE)
+ IF (NOT CMAKE_COMPILER_IS_GNUCC)
+ # This is for the intel compiler
+ SET (_boost_COMPILER "-il")
+ ELSE (NOT CMAKE_COMPILER_IS_GNUCC)
+ IF (NOT CYGWIN)
+ #find out the version of gcc being used.
+ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
+ ARGS --version
+ OUTPUT_VARIABLE _boost_COMPILER_VERSION
+ )
+ STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.[0-9] .*" "\\1\\2"
+ _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
+ SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
+ ENDIF (NOT CYGWIN)
+ ENDIF (NOT CMAKE_COMPILER_IS_GNUCC)
+ ENDIF (APPLE)
+ ENDIF(UNIX)
+
+ SET (_boost_MULTITHREADED "-mt")
+
+ IF( NOT Boost_USE_MULTITHREADED )
+ SET (_boost_MULTITHREADED "")
+ ENDIF( NOT Boost_USE_MULTITHREADED )
+
+ SET( _boost_STATIC_TAG "")
+ IF (WIN32)
+ SET (_boost_ABI_TAG "g")
+ SET( _boost_STATIC_TAG "-s")
+ ENDIF(WIN32)
+ SET (_boost_ABI_TAG "${_boost_ABI_TAG}d")
+
+ # ------------------------------------------------------------------------
+ # Begin finding boost libraries
+ # ------------------------------------------------------------------------
+ FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
+ MESSAGE(STATUS "look for component ${COMPONENT}")
+ STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+ SET( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
+ SET( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" )
+ SET( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND")
+
+ # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
+ IF( Boost_USE_STATIC_LIBS )
+ SET( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ IF(WIN32)
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ ELSE(WIN32)
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ ENDIF(WIN32)
+ ENDIF( Boost_USE_STATIC_LIBS )
+
+# MESSAGE(STATUS "look for sufixes ${CMAKE_FIND_LIBRARY_SUFFIXES}")
+# MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}")
+# MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}")
+# MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}")
+# MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}")
+# MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}")
+# MESSAGE(STATUS "PATHS ${_boost_LIBRARIES_SEARCH_DIRS}")
+
+ FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
+ NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}
+ PATHS ${_boost_LIBRARIES_SEARCH_DIRS}
+ NO_DEFAULT_PATH
+ )
+ MESSAGE(STATUS "found ? ${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
+
+ IF( NOT ${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE} )
+# MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}")
+# MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}")
+# MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}")
+# MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}")
+# MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}")
+ FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
+ NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}
+ )
+# MESSAGE(STATUS "found ? ${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
+ ENDIF( NOT ${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE} )
+
+ FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
+ NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG}
+ PATHS ${_boost_LIBRARIES_SEARCH_DIRS}
+ NO_DEFAULT_PATH
+ )
+
+ IF( NOT ${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG} )
+ FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
+ NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG}
+ )
+ ENDIF( NOT ${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG} )
+ _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
+ IF( Boost_USE_STATIC_LIBS )
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
+ ENDIF( Boost_USE_STATIC_LIBS )
+ ENDFOREACH(COMPONENT)
+ # ------------------------------------------------------------------------
+ # End finding boost libraries
+ # ------------------------------------------------------------------------
+
+ SET(Boost_INCLUDE_DIRS
+ ${Boost_INCLUDE_DIR}
+ )
+
+ MESSAGE(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
+ MESSAGE(STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}")
+
+ SET(Boost_FOUND FALSE)
+ IF(Boost_INCLUDE_DIR)
+ SET( Boost_FOUND TRUE )
+ IF( Boost_FIND_VERSION_MAJOR AND Boost_VERSION_MAJOR LESS "${Boost_FIND_VERSION_MAJOR}" )
+ MESSAGE(STATUS "Boost major version less than required")
+ SET( Boost_FOUND FALSE )
+ ELSE( Boost_FIND_VERSION_MAJOR AND Boost_VERSION_MAJOR LESS "${Boost_FIND_VERSION_MAJOR}" )
+ IF( Boost_FIND_VERSION_MINOR AND Boost_VERSION_MINOR LESS "${Boost_FIND_VERSION_MINOR}" )
+ MESSAGE(STATUS "Boost minor version less than required")
+ SET( Boost_FOUND FALSE )
+ ELSE( Boost_FIND_VERSION_MINOR AND Boost_VERSION_MINOR LESS "${Boost_FIND_VERSION_MINOR}" )
+ IF( Boost_FIND_VERSION_PATCH AND Boost_VERSION_SUBMINOR LESS "${Boost_FIND_VERSION_PATCH}" )
+ MESSAGE(STATUS "Boost patch version less than required")
+ SET( Boost_FOUND FALSE )
+ ENDIF( Boost_FIND_VERSION_PATCH AND Boost_VERSION_SUBMINOR LESS "${Boost_FIND_VERSION_PATCH}" )
+ ENDIF( Boost_FIND_VERSION_MINOR AND Boost_VERSION_MINOR LESS "${Boost_FIND_VERSION_MINOR}" )
+ ENDIF( Boost_FIND_VERSION_MAJOR AND Boost_VERSION_MAJOR LESS "${Boost_FIND_VERSION_MAJOR}" )
+ set(_boost_CHECKED_COMPONENT FALSE)
+ FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
+ STRING(TOUPPER ${COMPONENT} COMPONENT)
+ set(_boost_CHECKED_COMPONENT TRUE)
+ IF(NOT Boost_${COMPONENT}_FOUND)
+ MESSAGE(STATUS "Boost component not found ${COMPONENT}")
+ SET( Boost_FOUND FALSE)
+ ENDIF(NOT Boost_${COMPONENT}_FOUND)
+ ENDFOREACH(COMPONENT)
+ IF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
+ # Compatibility Code for backwards compatibility with CMake 2.4
+
+ # Look for the boost library path.
+ # Note that the user may not have installed any libraries
+ # so it is quite possible the Boost_LIBRARY_PATH may not exist.
+ SET(_boost_LIB_DIR ${Boost_INCLUDE_DIR})
+
+ IF("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
+ GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
+ ENDIF ("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
+
+ IF("${_boost_LIB_DIR}" MATCHES "/include$")
+ # Strip off the trailing "/include" in the path.
+ GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
+ ENDIF("${_boost_LIB_DIR}" MATCHES "/include$")
+
+ IF(EXISTS "${_boost_LIB_DIR}/lib")
+ SET (_boost_LIB_DIR ${_boost_LIB_DIR}/lib)
+ ELSE(EXISTS "${_boost_LIB_DIR}/lib")
+ IF(EXISTS "${_boost_LIB_DIR}/stage/lib")
+ SET(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib)
+ ELSE(EXISTS "${_boost_LIB_DIR}/stage/lib")
+ SET(_boost_LIB_DIR "")
+ ENDIF(EXISTS "${_boost_LIB_DIR}/stage/lib")
+ ENDIF(EXISTS "${_boost_LIB_DIR}/lib")
+
+ IF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
+ SET(Boost_LIBRARY_DIRS ${_boost_LIB_DIR})
+ ENDIF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
+
+ ENDIF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
+
+ ELSE(Boost_INCLUDE_DIR)
+ SET( Boost_FOUND FALSE)
+ ENDIF(Boost_INCLUDE_DIR)
+
+ IF (Boost_FOUND)
+ IF (NOT Boost_FIND_QUIETLY)
+ MESSAGE(STATUS "Found The Following Boost Libraries:")
+ FOREACH ( COMPONENT ${Boost_FIND_COMPONENTS} )
+ STRING( TOUPPER ${COMPONENT} UPPERCOMPONENT )
+ IF ( Boost_${UPPERCOMPONENT}_FOUND )
+ MESSAGE (STATUS " ${COMPONENT}")
+ SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY})
+ ENDIF ( Boost_${UPPERCOMPONENT}_FOUND )
+ ENDFOREACH(COMPONENT)
+ MESSAGE(STATUS "Boost Version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
+ ENDIF(NOT Boost_FIND_QUIETLY)
+ ELSE (Boost_FOUND)
+ IF (Boost_FIND_REQUIRED)
+ MESSAGE(STATUS "Boost Version required: ${Boost_FIND_VERSION}. Found: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
+ MESSAGE(FATAL_ERROR "Couldn't find the Boost libraries and/or include directory, or the version found is too old. Please install the Boost libraries AND development packages. You can set BOOST_ROOT, BOOST_INCLUDEDIR and BOOST_LIBRARYDIR to help find Boost.")
+ ENDIF(Boost_FIND_REQUIRED)
+ ENDIF(Boost_FOUND)
+
+ # Under Windows, automatic linking is performed, so no need to specify the libraries.
+ IF (WIN32)
+ SET(Boost_LIBRARIES "")
+ ENDIF(WIN32)
+
+ # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view
+ MARK_AS_ADVANCED(Boost_INCLUDE_DIRS
+ Boost_LIBRARIES
+ Boost_LIBRARY_DIRS
+ )
+ENDIF(_boost_IN_CACHE)
=== added file 'cmake_modules/FindGooglePerfTools.cmake'
--- cmake_modules/FindGooglePerfTools.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindGooglePerfTools.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,44 @@
+# 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.
+#
+# - Find Google Perf Tools
+#
+# GooglePerfTools_LIBRARIES - List of libraries when using Google Perf tools.
+# GooglePerfTools_FOUND - True if Google Perf tools found.
+
+
+SET(GooglePerfTools_NAMES profiler)
+FIND_LIBRARY(GooglePerfTools_LIBRARY
+ NAMES ${GooglePerfTools_NAMES}
+ PATHS /usr/lib /usr/local/lib /opt/local/lib
+)
+
+IF (GooglePerfTools_LIBRARY)
+ SET(GooglePerfTools_FOUND TRUE)
+ SET( GooglePerfTools_LIBRARIES ${GooglePerfTools_LIBRARY} )
+ELSE (GooglePerfTools_LIBRARY)
+ SET(GooglePerfTools_FOUND FALSE)
+ SET( GooglePerfTools_LIBRARIES )
+ENDIF (GooglePerfTools_LIBRARY)
+
+IF (GooglePerfTools_FOUND)
+ MESSAGE(STATUS "Found GooglePerfTools: ${GooglePerfTools_LIBRARY}")
+ELSE (GooglePerfTools_FOUND)
+ MESSAGE(STATUS "Not Found GooglePerfTools: ${GooglePerfTools_LIBRARY}")
+ENDIF (GooglePerfTools_FOUND)
+
+MARK_AS_ADVANCED(
+ GooglePerfTools_LIBRARY
+)
+
=== added file 'cmake_modules/FindICU.cmake'
--- cmake_modules/FindICU.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindICU.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,156 @@
+# 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.
+
+# - Find the International Components for Unicode (ICU) Library
+#
+# Once done this will define
+#
+# ICU_FOUND - True if ICU found.
+# ICU_I18N_FOUND - True if ICU's internationalization library found.
+# ICU_DATA_FOUND - True if ICU data library found.
+#
+# ICU_INCLUDE_DIRS - Directory to include to get ICU headers
+# Note: always include ICU headers as, e.g.,
+# unicode/utypes.h
+# ICU_LIBRARIES - Libraries to link against for the common ICU
+# ICU_I18N_LIBRARIES - Libraries to link against for ICU internationaliation
+# (note: in addition to ICU_LIBRARIES)
+# ICU_DATA_LIBRARIES - Libraries to link against for ICU data
+#
+# ICU_VERSION - ICU's version number.
+#
+
+# Look for the header file.
+find_path(
+ ICU_INCLUDE
+ NAMES unicode/utypes.h
+ PATHS ${ICU_INCLUDE_DIR}
+ DOC "Include directory for the ICU library")
+mark_as_advanced(ICU_INCLUDE)
+
+# Look for the library.
+find_library(
+ ICU_LIBRARY
+ NAMES icuuc cygicuuc cygicuuc32 cygicuuc38
+ PATHS ${ICU_LIBRARY_DIR}
+ DOC "Libraries to link against for the common parts of ICU (icuuc, cygicuuc, cygicuuc32 or cygicuuc38)")
+mark_as_advanced(ICU_LIBRARY)
+
+if (ICU_LIBRARY)
+ MESSAGE(STATUS "Found ICU library -- " ${ICU_LIBRARY})
+else (ICU_LIBRARY)
+ MESSAGE(STATUS "Could not find ICU library")
+endif (ICU_LIBRARY)
+
+# Discover the version.
+IF (NOT ICU_INCLUDE STREQUAL "")
+ # ICU 3.x has the relevant #defines in uversion.h; 4.x uses uvernum.h.
+ FIND_PATH(ICUVERHPPPATH NAMES unicode/uvernum.h unicode/uversion.h
+ PATHS ${ICU_INCLUDE} NO_DEFAULT_PATH)
+
+ IF ( ${ICUVERHPPPATH} STREQUAL ICUVERHPPPATH-NOTFOUND )
+ SET(ICU_VERSION "0")
+ MESSAGE(STATUS "Found ICU but unable to determine version - assuming version 0")
+ ELSE( ${ICUVERHPPPATH} STREQUAL ICUVERHPPPATH-NOTFOUND )
+ SET (ICUVERHPP)
+ # One of these files has to exist, or else ICUVERHPPPATH wouldn't be set.
+ # If uvernum.h exists, it has the data we want; otherwise, that data is
+ # in uversion.h.
+ FOREACH (header uvernum.h uversion.h)
+ SET (headerfile "${ICUVERHPPPATH}/unicode/${header}")
+ IF (EXISTS "${headerfile}")
+ FILE(READ "${headerfile}" ICUVERHPP)
+ BREAK()
+ ENDIF (EXISTS "${headerfile}")
+ ENDFOREACH (header)
+
+ STRING(REGEX MATCH "\n *#define U_ICU_VERSION_MAJOR_NUM +[0-9]+" ICUVERMAJ
+ ${ICUVERHPP})
+ STRING(REGEX MATCH "\n *#define U_ICU_VERSION_MINOR_NUM +[0-9]+" ICUVERMIN
+ ${ICUVERHPP})
+ STRING(REGEX
+ MATCH "\n *#define U_ICU_VERSION_PATCHLEVEL_NUM +[0-9]+" ICUVERPATCH
+ ${ICUVERHPP})
+
+ STRING(REGEX REPLACE "\n *#define U_ICU_VERSION_MAJOR_NUM +" ""
+ ICUVERMAJ ${ICUVERMAJ})
+ STRING(REGEX REPLACE "\n *#define U_ICU_VERSION_MINOR_NUM +" ""
+ ICUVERMIN ${ICUVERMIN})
+ STRING(REGEX REPLACE "\n *#define U_ICU_VERSION_PATCHLEVEL_NUM +" ""
+ ICUVERPATCH ${ICUVERPATCH})
+
+ SET(ICU_VERSION ${ICUVERMAJ}.${ICUVERMIN}.${ICUVERPATCH})
+ MESSAGE(STATUS "ICU Version: ${ICU_VERSION}")
+
+ ENDIF ( ${ICUVERHPPPATH} STREQUAL ICUVERHPPPATH-NOTFOUND )
+ENDIF (NOT ICU_INCLUDE STREQUAL "")
+
+
+# Copy the results to the output variables.
+if(ICU_INCLUDE AND ICU_LIBRARY)
+ set(ICU_FOUND 1)
+ set(ICU_LIBRARIES ${ICU_LIBRARY})
+ set(ICU_INCLUDE_DIRS ${ICU_INCLUDE})
+
+ # Look for the ICU internationalization libraries
+ find_library(
+ ICU_I18N_LIBRARY
+ NAMES icuin icui18n cygicuin cygicuin32 cygicuin38
+ PATHS ${ICU_LIBRARY_DIR}
+ DOC "Libraries to link against for ICU internationalization (icuin, icui18n, cygicuin, cygicuin32 or cygicuin38)")
+ mark_as_advanced(ICU_I18N_LIBRARY)
+ if (ICU_I18N_LIBRARY)
+ MESSAGE(STATUS "Found ICU internationalization library -- " ${ICU_I18N_LIBRARY})
+ set(ICU_I18N_FOUND 1)
+ set(ICU_I18N_LIBRARIES ${ICU_I18N_LIBRARY})
+ else (ICU_I18N_LIBRARY)
+ MESSAGE(STATUS "Could not find ICU internationalization library")
+ set(ICU_I18N_FOUND 0)
+ set(ICU_I18N_LIBRARIES)
+ endif (ICU_I18N_LIBRARY)
+
+ # On cygwin, the data library is called icudt
+ if (CYGWIN OR MSVC)
+ SET (ICU_DATA_NAMES icudt cygicudt cygicudt38)
+ else (CYGWIN OR MSVC)
+ SET (ICU_DATA_NAMES icudata)
+ endif (CYGWIN OR MSVC)
+
+ # Look for ICU data library
+ find_library(
+ ICU_DATA_LIBRARY
+ NAMES ${ICU_DATA_NAMES}
+ PATHS ${ICU_LIBRARY_DIR}
+ DOC "icudata library (icudt, cygicudt or cygicudt38)")
+ mark_as_advanced(ICU_DATA_LIBRARY)
+ if (ICU_DATA_LIBRARY)
+ MESSAGE(STATUS "Found ICU data library -- " ${ICU_DATA_LIBRARY})
+ SET(ICU_DATA_FOUND 1)
+ SET(ICU_DATA_LIBRARIES ${ICU_DATA_LIBRARY})
+ else (ICU_DATA_LIBRARY)
+ MESSAGE(STATUS "Could not find ICU data library")
+ SET(ICU_DATA_FOUND 0)
+ SET(ICU_DATA_LIBRARIES)
+ endif (ICU_DATA_LIBRARY)
+
+else(ICU_INCLUDE AND ICU_LIBRARY)
+ set(ICU_FOUND 0)
+ set(ICU_I18N_FOUND 0)
+ set(ICU_DATA_FOUND 0)
+ set(ICU_LIBRARIES)
+ set(ICU_I18N_LIBRARIES)
+ set(ICU_DATA_LIBRARIES)
+ set(ICU_INCLUDE_DIRS)
+ set(ICU_VERSION 0)
+endif(ICU_INCLUDE AND ICU_LIBRARY)
=== added file 'cmake_modules/FindIconv.cmake'
--- cmake_modules/FindIconv.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindIconv.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,62 @@
+# 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.
+
+# - Try to find Iconv
+#
+# Once done this will define
+#
+# ICONV_FOUND - system has Iconv
+# ICONV_INCLUDE_DIR - the Iconv include directory
+# ICONV_LIBRARY - Link these to use Iconv
+# ICONV_LIBRARY_DIR - the directory in which iconv is searched
+#
+
+
+IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY)
+ # in cache already
+ SET(Iconv_FIND_QUIETLY TRUE)
+ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY)
+
+FIND_PATH(ICONV_INCLUDE_DIR iconv.h
+ HINTS ${ICONV_INCLUDE_HINT}
+ /usr/include
+ /usr/local/include
+ DOC "Include directory for the Iconv library linkage (the path to iconv.h file)"
+)
+
+FIND_LIBRARY(ICONV_LIBRARY NAMES iconv
+ HINTS ${ICONV_LIBRARY_HINT}
+ PATHS
+ /usr/${LIB_DESTINATION}
+ /usr/local/${LIB_DESTINATION}
+ DOC "Iconv library that used by Libxml2 (iconv)"
+)
+
+IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY)
+ SET(ICONV_FOUND TRUE)
+ELSE (ICONV_INCLUDE_DIR AND ICONV_LIBRARY)
+ SET(ICONV_FOUND FALSE)
+ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARY)
+
+IF(ICONV_FOUND)
+ IF(NOT Iconv_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARY}")
+ ENDIF(NOT Iconv_FIND_QUIETLY)
+ELSE(ICONV_FOUND)
+ IF(Iconv_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Iconv")
+ ENDIF(Iconv_FIND_REQUIRED)
+ENDIF(ICONV_FOUND)
+
+MARK_AS_ADVANCED(ICONV_INCLUDE_DIR ICONV_LIBRARY)
=== added file 'cmake_modules/FindJNI.cmake'
--- cmake_modules/FindJNI.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindJNI.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,286 @@
+# - Find JNI java libraries.
+# This module finds if Java is installed and determines where the
+# include files and libraries are. It also determines what the name of
+# the library is. This code sets the following variables:
+#
+# JNI_INCLUDE_DIRS = the include dirs to use
+# JNI_LIBRARIES = the libraries to use
+# JNI_FOUND = TRUE if JNI headers and libraries were found.
+# JAVA_AWT_LIBRARY = the path to the jawt library
+# JAVA_JVM_LIBRARY = the path to the jvm library
+# JAVA_INCLUDE_PATH = the include path to jni.h
+# JAVA_INCLUDE_PATH2 = the include path to jni_md.h
+# JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
+#
+
+#=============================================================================
+# Copyright 2001-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var}
+MACRO(java_append_library_directories _var)
+ # Determine java arch-specific library subdir
+ # Mostly based on openjdk/jdk/make/common/shared/Platform.gmk as of openjdk
+ # 1.6.0_18 + icedtea patches. However, it would be much better to base the
+ # guess on the first part of the GNU config.guess platform triplet.
+ IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ SET(_java_libarch "amd64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
+ SET(_java_libarch "i386")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
+ SET(_java_libarch "alpha")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
+ # Subdir is "arm" for both big-endian (arm) and little-endian (armel).
+ SET(_java_libarch "arm")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
+ # mips* machines are bi-endian mostly so processor does not tell
+ # endianess of the underlying system.
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
+ SET(_java_libarch "ppc64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
+ SET(_java_libarch "ppc")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
+ # Both flavours can run on the same processor
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
+ SET(_java_libarch "parisc" "parisc64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
+ # s390 binaries can run on s390x machines
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
+ SET(_java_libarch "sh")
+ ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
+ ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+
+ # Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or
+ # system is non-Linux (where the code above has not been well tested)
+ IF(NOT _java_libarch OR NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
+ LIST(APPEND _java_libarch "i386" "amd64" "ppc")
+ ENDIF(NOT _java_libarch OR NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
+
+ # Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer
+ # current value to a hardcoded list. Remove possible duplicates.
+ LIST(REMOVE_DUPLICATES _java_libarch)
+
+ FOREACH(_path ${ARGN})
+ IF(_path MATCHES "{libarch}")
+ FOREACH(_libarch ${_java_libarch})
+ STRING(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
+ LIST(APPEND ${_var} "${_newpath}")
+ ENDFOREACH(_libarch)
+ ELSE(_path MATCHES "{libarch}")
+ LIST(APPEND ${_var} "${_path}")
+ ENDIF(_path MATCHES "{libarch}")
+ ENDFOREACH(_path)
+ENDMACRO(java_append_library_directories)
+
+GET_FILENAME_COMPONENT(java_install_version
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME)
+
+SET(JAVA_AWT_LIBRARY_DIRECTORIES
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib"
+ )
+
+FILE(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _JAVA_HOME)
+
+JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
+ ${_JAVA_HOME}/jre/lib/{libarch}
+ ${_JAVA_HOME}/jre/lib
+ ${_JAVA_HOME}/lib
+ ${_JAVA_HOME}
+ /usr/lib/jvm/java-6-openjdk/jre/lib
+ /usr/lib/jvm/java-6-openjdk-i386/jre/lib
+ /usr/lib/jvm/java-6-openjdk-amd64/jre/lib
+ /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
+ /usr/lib/jvm/java-6-openjdk-i386/jre/lib/{libarch}
+ /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/{libarch}
+ /usr/lib
+ /usr/local/lib
+ /usr/lib/jvm/java/lib
+ /usr/lib/java/jre/lib/{libarch}
+ /usr/local/lib/java/jre/lib/{libarch}
+ /usr/local/share/java/jre/lib/{libarch}
+ /usr/lib/j2sdk1.4-sun/jre/lib/{libarch}
+ /usr/lib/j2sdk1.5-sun/jre/lib/{libarch}
+ /opt/sun-jdk-1.5.0.04/jre/lib/{libarch}
+ /usr/lib/jvm/java-6-sun/jre/lib/{libarch}
+ /usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch}
+ /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch} # can this one be removed according to #8821 ? Alex
+ /usr/lib/jvm/java-openjdk/jre/lib/{libarch}
+ # Debian specific paths for default JVM
+ /usr/lib/jvm/default-java/jre/lib/{libarch}
+ /usr/lib/jvm/default-java/jre/lib
+ /usr/lib/jvm/default-java/lib
+ )
+
+SET(JAVA_JVM_LIBRARY_DIRECTORIES)
+FOREACH(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
+ SET(JAVA_JVM_LIBRARY_DIRECTORIES
+ ${JAVA_JVM_LIBRARY_DIRECTORIES}
+ "${dir}"
+ "${dir}/client"
+ "${dir}/server"
+ )
+ENDFOREACH(dir)
+
+
+SET(JAVA_AWT_INCLUDE_DIRECTORIES
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
+ ${_JAVA_HOME}/include
+ /usr/lib/jvm/java-6-openjdk/include
+ /usr/lib/jvm/java-6-openjdk-amd64/include
+ /usr/lib/jvm/java-6-openjdk-i386/include
+ /usr/include
+ /usr/local/include
+ /usr/lib/java/include
+ /usr/local/lib/java/include
+ /usr/lib/jvm/java/include
+ /usr/lib/jvm/java-6-sun/include
+ /usr/lib/jvm/java-1.5.0-sun/include
+ /usr/lib/jvm/java-6-sun-1.6.0.00/include # can this one be removed according to #8821 ? Alex
+ /usr/lib/jvm/java-6-openjdk/include
+ /usr/local/share/java/include
+ /usr/lib/j2sdk1.4-sun/include
+ /usr/lib/j2sdk1.5-sun/include
+ /opt/sun-jdk-1.5.0.04/include
+ # Debian specific path for default JVM
+ /usr/lib/jvm/default-java/include
+ )
+
+FOREACH(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
+ GET_FILENAME_COMPONENT(jpath "${JAVA_PROG}" PATH)
+ FOREACH(JAVA_INC_PATH ../include ../java/include ../share/java/include)
+ IF(EXISTS ${jpath}/${JAVA_INC_PATH})
+ SET(JAVA_AWT_INCLUDE_DIRECTORIES ${JAVA_AWT_INCLUDE_DIRECTORIES} "${jpath}/${JAVA_INC_PATH}")
+ ENDIF(EXISTS ${jpath}/${JAVA_INC_PATH})
+ ENDFOREACH(JAVA_INC_PATH)
+ FOREACH(JAVA_LIB_PATH
+ ../lib ../jre/lib ../jre/lib/i386
+ ../java/lib ../java/jre/lib ../java/jre/lib/i386
+ ../share/java/lib ../share/java/jre/lib ../share/java/jre/lib/i386)
+ IF(EXISTS ${jpath}/${JAVA_LIB_PATH})
+ SET(JAVA_AWT_LIBRARY_DIRECTORIES ${JAVA_AWT_LIBRARY_DIRECTORIES} "${jpath}/${JAVA_LIB_PATH}")
+ ENDIF(EXISTS ${jpath}/${JAVA_LIB_PATH})
+ ENDFOREACH(JAVA_LIB_PATH)
+ENDFOREACH(JAVA_PROG)
+
+IF(APPLE)
+ IF(EXISTS ~/Library/Frameworks/JavaVM.framework)
+ SET(JAVA_HAVE_FRAMEWORK 1)
+ ENDIF(EXISTS ~/Library/Frameworks/JavaVM.framework)
+ IF(EXISTS /Library/Frameworks/JavaVM.framework)
+ SET(JAVA_HAVE_FRAMEWORK 1)
+ ENDIF(EXISTS /Library/Frameworks/JavaVM.framework)
+ IF(EXISTS /System/Library/Frameworks/JavaVM.framework)
+ SET(JAVA_HAVE_FRAMEWORK 1)
+ ENDIF(EXISTS /System/Library/Frameworks/JavaVM.framework)
+
+ IF(JAVA_HAVE_FRAMEWORK)
+ IF(NOT JAVA_AWT_LIBRARY)
+ SET (JAVA_AWT_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
+ ENDIF(NOT JAVA_AWT_LIBRARY)
+
+ IF(NOT JAVA_JVM_LIBRARY)
+ SET (JAVA_JVM_LIBRARY "-framework JavaVM" CACHE FILEPATH "Java Frameworks" FORCE)
+ ENDIF(NOT JAVA_JVM_LIBRARY)
+
+ IF(NOT JAVA_AWT_INCLUDE_PATH)
+ IF(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h)
+ SET (JAVA_AWT_INCLUDE_PATH "/System/Library/Frameworks/JavaVM.framework/Headers" CACHE FILEPATH "jawt.h location" FORCE)
+ ENDIF(EXISTS /System/Library/Frameworks/JavaVM.framework/Headers/jawt.h)
+ ENDIF(NOT JAVA_AWT_INCLUDE_PATH)
+
+ # If using "-framework JavaVM", prefer its headers *before* the others in
+ # JAVA_AWT_INCLUDE_DIRECTORIES... (*prepend* to the list here)
+ #
+ SET(JAVA_AWT_INCLUDE_DIRECTORIES
+ ~/Library/Frameworks/JavaVM.framework/Headers
+ /Library/Frameworks/JavaVM.framework/Headers
+ /System/Library/Frameworks/JavaVM.framework/Headers
+ ${JAVA_AWT_INCLUDE_DIRECTORIES}
+ )
+ ENDIF(JAVA_HAVE_FRAMEWORK)
+ELSE(APPLE)
+ FIND_LIBRARY(JAVA_AWT_LIBRARY jawt
+ PATHS ${JAVA_AWT_LIBRARY_DIRECTORIES}
+ )
+ FIND_LIBRARY(JAVA_JVM_LIBRARY NAMES jvm JavaVM java
+ PATHS ${JAVA_JVM_LIBRARY_DIRECTORIES}
+ )
+ENDIF(APPLE)
+
+# add in the include path
+FIND_PATH(JAVA_INCLUDE_PATH jni.h
+ ${JAVA_AWT_INCLUDE_DIRECTORIES}
+)
+
+FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
+ ${JAVA_INCLUDE_PATH}
+ ${JAVA_INCLUDE_PATH}/win32
+ ${JAVA_INCLUDE_PATH}/linux
+ ${JAVA_INCLUDE_PATH}/freebsd
+ ${JAVA_INCLUDE_PATH}/solaris
+)
+
+FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h
+ ${JAVA_INCLUDE_PATH}
+)
+
+
+IF (APPLE)
+ # On Mac, the java headers files are broken symlinks if the Apple Developer Tools for Java are not installed
+ EXECUTE_PROCESS(COMMAND cat ${JAVA_INCLUDE_PATH}/jni.h
+ OUTPUT_QUIET
+ ERROR_QUIET
+ RESULT_VARIABLE SYMLINK_CHECK_RESULT_VARIABLE)
+ IF (SYMLINK_CHECK_RESULT_VARIABLE GREATER 0)
+ SET (JAVA_INCLUDE_PATH "JAVA_INCLUDE_PATH-NOTFOUND")
+ SET (JAVA_INCLUDE_PATH2 "JAVA_INCLUDE_PATH2-NOTFOUND")
+ SET (JAVA_AWT_INCLUDE_PATH "JAVA_AWT_INCLUDE_PATH-NOTFOUND")
+ ENDIF()
+ENDIF (APPLE)
+
+
+#INCLUDE("${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake")
+#FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI DEFAULT_MSG JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY
+# JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
+
+MARK_AS_ADVANCED(
+ JAVA_AWT_LIBRARY
+ JAVA_JVM_LIBRARY
+ JAVA_AWT_INCLUDE_PATH
+ JAVA_INCLUDE_PATH
+ JAVA_INCLUDE_PATH2
+)
+
+IF (JAVA_AWT_LIBRARY AND JAVA_JVM_LIBRARY AND JAVA_INCLUDE_PATH AND JAVA_INCLUDE_PATH2 AND JAVA_AWT_INCLUDE_PATH)
+ SET(JNI_FOUND 1)
+ SET(JNI_LIBRARIES
+ ${JAVA_AWT_LIBRARY}
+ ${JAVA_JVM_LIBRARY}
+ )
+ SET(JNI_INCLUDE_DIRS
+ ${JAVA_INCLUDE_PATH}
+ ${JAVA_INCLUDE_PATH2}
+ ${JAVA_AWT_INCLUDE_PATH}
+ )
+ELSE (JAVA_AWT_LIBRARY AND JAVA_JVM_LIBRARY AND JAVA_INCLUDE_PATH AND JAVA_INCLUDE_PATH2 AND JAVA_AWT_INCLUDE_PATH)
+ SET(JNI_FOUND 0)
+ SET(JNI_LIBRARIES "")
+ SET(JNI_INCLUDE_DIRS "")
+ENDIF (JAVA_AWT_LIBRARY AND JAVA_JVM_LIBRARY AND JAVA_INCLUDE_PATH AND JAVA_INCLUDE_PATH2 AND JAVA_AWT_INCLUDE_PATH)
=== added file 'cmake_modules/FindKerberos.cmake'
--- cmake_modules/FindKerberos.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindKerberos.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,47 @@
+# 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.
+#
+# Finds the KERBEROS library
+#
+# KERBEROS_FOUND - True if SASL library found.
+# KERBEROS_LIBRARY - Libraries to link against for the SASL library
+#
+
+if (KERBEROS_LIBRARIES)
+ # Already in cache, be silent
+ set(KERBEROS_FIND_QUIETLY TRUE)
+endif (KERBEROS_LIBRARIES)
+
+# Look for the library.
+find_library(
+ KERBEROS_LIBRARY
+ NAMES gssapi_krb5
+ PATHS ${KERBEROS_LIBRARY_DIRS} /opt/local/lib /usr/lib /usr/local/lib
+ DOC "Library to link against for kerberos support (gssapi_krb5)")
+mark_as_advanced(KERBEROS_LIBRARY)
+
+if (KERBEROS_LIBRARY)
+ MESSAGE(STATUS "Found Kerberos library -- " ${KERBEROS_LIBRARY})
+else (KERBEROS_LIBRARY)
+ MESSAGE(STATUS "Could not find Kerberos library")
+endif (KERBEROS_LIBRARY)
+
+# Copy the results to the output variables.
+if(KERBEROS_LIBRARY)
+ set(KERBEROS_FOUND 1)
+else(KERBEROS_LIBRARY)
+ set(KERBEROS_FOUND 0)
+ set(KERBEROS_LIBRARY)
+ set(KERBEROS_INCLUDE)
+endif(KERBEROS_LIBRARY)
=== added file 'cmake_modules/FindLibedit.cmake'
--- cmake_modules/FindLibedit.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindLibedit.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,46 @@
+# Copyright 2011 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.
+#
+# - Try to find the libedit library
+#
+# Once done this will define
+#
+# LIBEDIT_FOUND - True if libedit library is found
+# LIBEDIT_INCLUDE_DIRS - Directory to include to get libedit headers
+# LIBEDIT_LIBRARIES - Libraries to link against for the libedit library
+#
+
+FIND_PATH (
+ LIBEDIT_INCLUDE
+ editline/readline.h
+ PATHS ${LIBEDIT_INCLUDE_DIR} /usr/include /usr/local/include
+)
+MESSAGE(STATUS ${LIBEDIT_INCLUDE})
+
+FIND_LIBRARY (
+ LIBEDIT_LIBRARY
+ NAMES edit
+ PATHS ${LIBEDIT_LIBRARY_DIR} /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
+)
+MESSAGE(STATUS ${LIBEDIT_LIBRARY})
+
+SET (LIBEDIT_INCLUDE_DIRS ${LIBEDIT_INCLUDE})
+SET (LIBEDIT_LIBRARIES ${LIBEDIT_LIBRARY})
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (
+ Libedit
+ DEFAULT_MSG
+ LIBEDIT_INCLUDE LIBEDIT_LIBRARY
+)
+
=== added file 'cmake_modules/FindPAM.cmake'
--- cmake_modules/FindPAM.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindPAM.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,37 @@
+# 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.
+#
+# Try to find the PAM libraries
+#
+# PAM_FOUND - True if PAM library found
+# PAM_INCLUDE_DIR - Directory to include to get PAM headers
+# PAM_LIBRARIES - Libraries to link against for the PAM library
+
+if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
+ # Already in cache, be silent
+ set(PAM_FIND_QUIETLY TRUE)
+endif (PAM_INCLUDE_DIR AND PAM_LIBRARY)
+
+find_path(PAM_INCLUDE_DIR NAMES security/pam_appl.h pam/pam_appl.h)
+find_library(PAM_LIBRARY pam)
+find_library(DL_LIBRARY dl)
+
+if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
+ set(PAM_FOUND TRUE)
+ if (DL_LIBRARY)
+ set(PAM_LIBRARIES ${PAM_LIBRARY} ${DL_LIBRARY})
+ else (DL_LIBRARY)
+ set(PAM_LIBRARIES ${PAM_LIBRARY})
+ endif (DL_LIBRARY)
+endif (PAM_INCLUDE_DIR AND PAM_LIBRARY)
=== added file 'cmake_modules/FindPHP5.cmake'
--- cmake_modules/FindPHP5.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindPHP5.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,184 @@
+# 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.
+#
+# - Find PHP5
+# This module finds if PHP5 is installed and determines where the include files
+# and libraries are. It also determines what the name of the library is. This
+# code sets the following variables:
+#
+# PHP5_FOUND = system has PHP5
+# PHP5_INCLUDE_PATH = path to where php.h can be found
+# PHP5_EXECUTABLE = full path to the php5 binary
+#
+# file is derived from FindPHP4.cmake
+#
+
+SET(PHP5_FOUND "NO")
+
+SET(PHP5_POSSIBLE_INCLUDE_PATHS
+ /usr/include/php5
+ /usr/local/include/php5
+ /usr/include/php
+ /usr/local/include/php
+ /usr/local/apache/php
+ )
+
+SET(PHP5_POSSIBLE_LIB_PATHS
+ /usr/lib
+ )
+
+#FIND_PATH(PHP5_FOUND_INCLUDE_PATH main/php.h
+# ${PHP5_POSSIBLE_INCLUDE_PATHS})
+#
+#IF(PHP5_FOUND_INCLUDE_PATH)
+# SET(php5_paths "${PHP5_POSSIBLE_INCLUDE_PATHS}")
+# FOREACH(php5_path Zend main TSRM)
+# SET(php5_paths ${php5_paths} "${PHP5_FOUND_INCLUDE_PATH}/${php5_path}")
+# ENDFOREACH(php5_path Zend main TSRM)
+# SET(PHP5_INCLUDE_PATH "${php5_paths}" INTERNAL "PHP5 include paths")
+#ENDIF(PHP5_FOUND_INCLUDE_PATH)
+
+FIND_PROGRAM(PHP5_EXECUTABLE
+ NAMES php5 php
+ PATHS
+ /usr/bin
+ /usr/local/bin
+ ${PHP5_BINARY_DIR}
+ )
+MESSAGE(STATUS "Executable: " ${PHP5_EXECUTABLE})
+
+
+FIND_LIBRARY(PHP5_LIBRARY
+ NAMES php5ts php5
+ PATHS
+ /usr/bin
+ /usr/local/bin
+ ${PHP5_BINARY_DIR}
+ )
+
+MESSAGE(STATUS "Library: " ${PHP5_LIBRARY})
+
+MARK_AS_ADVANCED(
+ PHP5_EXECUTABLE
+ PHP5_FOUND_INCLUDE_PATH
+ )
+
+IF(APPLE)
+MESSAGE(STATUS "Darwin Environment Configuration...")
+# this is a hack for now
+ SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+ "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace")
+ FOREACH(symbol
+ _convert_to_boolean
+ _gc_remove_zval_from_buffer
+ _zend_throw_exception
+ _zend_register_long_constant
+ _zend_get_constant
+ __zval_copy_ctor_func
+ __convert_to_string
+ __estrndup
+ __efree
+ __emalloc
+ __estrdup
+ __object_init_ex
+ __zend_get_parameters_array_ex
+ __zend_list_find
+ __zval_copy_ctor
+ _add_property_zval_ex
+ _alloc_globals
+ _compiler_globals
+ _convert_to_double
+ _convert_to_long
+ _zend_error
+ _zend_hash_find
+ _zend_register_internal_class_ex
+ _zend_register_list_destructors_ex
+ _zend_register_resource
+ _zend_rsrc_list_get_rsrc_type
+ _zend_wrong_param_count
+ _zval_used_for_init
+ _zval_is_true
+ _zend_lookup_class
+ __object_init
+ __zend_hash_add_or_update
+ _php_strtolower
+ _executor_globals
+ _call_user_function
+ _php_sprintf
+ )
+ SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+ "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")
+ ENDFOREACH(symbol)
+ENDIF(APPLE)
+
+IF (NOT WIN32 OR CYGWIN)
+MESSAGE(STATUS "*NIX Environment Configuration...")
+FIND_PROGRAM(PHP5_CONFIG_EXECUTABLE
+ NAMES php5-config php-config
+ PATHS
+ /usr/bin
+ /usr/local/bin
+ )
+
+EXECUTE_PROCESS(COMMAND ${PHP5_CONFIG_EXECUTABLE} --version
+ OUTPUT_VARIABLE PHP5_VERSION)
+
+EXECUTE_PROCESS(COMMAND ${PHP5_CONFIG_EXECUTABLE} --extension-dir
+ OUTPUT_VARIABLE PHP5_EXTENSION_DIR)
+
+STRING(REPLACE "\n" "" PHP5_EXTENSION_DIR "${PHP5_EXTENSION_DIR}")
+
+EXECUTE_PROCESS(COMMAND ${PHP5_CONFIG_EXECUTABLE} --includes
+ OUTPUT_VARIABLE PHP5_INCLUDES)
+STRING(REPLACE "-I" ";" PHP5_INCLUDES "${PHP5_INCLUDES}")
+STRING(REPLACE " " "" PHP5_INCLUDES "${PHP5_INCLUDES}")
+STRING(REPLACE "\n" "" PHP5_INCLUDES "${PHP5_INCLUDES}")
+STRING(LENGTH "${PHP5_INCLUDES}" PHP5_INCLUDES_LENGTH )
+
+IF(PHP5_INCLUDES)
+ MATH(EXPR PHP5_INCLUDES_LENGTH ${PHP5_INCLUDES_LENGTH}-1)
+ STRING(SUBSTRING "${PHP5_INCLUDES}" 1 ${PHP5_INCLUDES_LENGTH} PHP5_INCLUDES)
+ LIST(GET PHP5_INCLUDES 0 PHP5_INCLUDE_DIR)
+ENDIF(PHP5_INCLUDES)
+
+IF(PHP5_VERSION LESS 5)
+ MESSAGE(FATAL_ERROR "PHP version is not 5 or later")
+ENDIF(PHP5_VERSION LESS 5)
+
+ELSE (NOT WIN32 OR CYGWIN)
+
+################ WINDOWS CONFIG
+
+IF(NOT PHP5_INCLUDE_DIR )
+ SET (PHP5_INCLUDE_DIR ${CMAKE_PREFIX_PATH})
+ENDIF(NOT PHP5_INCLUDE_DIR )
+
+MESSAGE(STATUS "Windows Environment Configuration.")
+MESSAGE(STATUS "PHP Path: " ${PHP5_INCLUDE_DIR})
+SET(PHP5_INCLUDES ${PHP5_INCLUDE_DIR})
+
+ENDIF (NOT WIN32 OR CYGWIN)
+
+set(PHP5_MAIN_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/main)
+set(PHP5_TSRM_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/TSRM)
+set(PHP5_ZEND_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/Zend)
+set(PHP5_REGEX_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/regex)
+set(PHP5_EXT_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/ext)
+set(PHP5_DATE_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/ext/date/lib)
+set(PHP5_STANDARD_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/ext/standard)
+
+IF(PHP5_EXECUTABLE AND PHP5_INCLUDES)
+ SET(PHP5_FOUND "yes")
+ MESSAGE(STATUS "Found PHP5-Version ${PHP5_VERSION}")
+ENDIF(PHP5_EXECUTABLE AND PHP5_INCLUDES)
=== added file 'cmake_modules/FindPythonLibs.cmake'
--- cmake_modules/FindPythonLibs.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindPythonLibs.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,195 @@
+# - Find python libraries
+# This module finds if Python is installed and determines where the
+# include files and libraries are. It also determines what the name of
+# the library is. This code sets the following variables:
+#
+# 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
+# Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for
+
+#=============================================================================
+# Copyright 2001-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+INCLUDE(CMakeFindFrameworks)
+# Search for the python framework on Apple.
+CMAKE_FIND_FRAMEWORKS(Python)
+
+# Set up the versions we know about, in the order we will search. Always add
+# the user supplied additional versions to the front.
+set(_Python_VERSIONS
+ ${Python_ADDITIONAL_VERSIONS}
+ 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
+
+FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
+ STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
+ IF(WIN32)
+ FIND_LIBRARY(PYTHON_DEBUG_LIBRARY
+ NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
+ PATHS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs )
+ ENDIF(WIN32)
+
+ FIND_LIBRARY(PYTHON_LIBRARY
+ NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
+ PATHS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
+ # Avoid finding the .dll in the PATH. We want the .lib.
+ NO_SYSTEM_ENVIRONMENT_PATH
+ )
+ # Look for the static library in the Python config directory
+ FIND_LIBRARY(PYTHON_LIBRARY
+ NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
+ # Avoid finding the .dll in the PATH. We want the .lib.
+ NO_SYSTEM_ENVIRONMENT_PATH
+ # This is where the static library is usually located
+ PATH_SUFFIXES python${_CURRENT_VERSION}/config libs
+ )
+
+ # For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if
+ # PYTHON_INCLUDE_DIR is not set.
+ IF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+ SET(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
+ "Path to where Python.h is found" FORCE)
+ ENDIF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR)
+
+ SET(PYTHON_FRAMEWORK_INCLUDES)
+ IF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+ FOREACH(dir ${Python_FRAMEWORKS})
+ SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
+ ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
+ ENDFOREACH(dir)
+ ENDIF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+
+ FIND_PATH(PYTHON_INCLUDE_DIR
+ NAMES Python.h
+ PATHS
+ ${PYTHON_FRAMEWORK_INCLUDES}
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
+ PATH_SUFFIXES
+ python${_CURRENT_VERSION}
+ )
+
+ # For backward compatibility, set PYTHON_INCLUDE_PATH, but make it internal.
+ SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL
+ "Path to where Python.h is found (deprecated)")
+
+ENDFOREACH(_CURRENT_VERSION)
+
+MARK_AS_ADVANCED(
+ PYTHON_DEBUG_LIBRARY
+ PYTHON_LIBRARY
+ PYTHON_INCLUDE_DIR
+)
+
+# We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the
+# cache entries because they are meant to specify the location of a single
+# library. We now set the variables listed by the documentation for this
+# module.
+SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
+SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
+SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
+
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
+
+
+# PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.
+# PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include
+# in your sources to initialize the static python modules
+FUNCTION(PYTHON_ADD_MODULE _NAME )
+ GET_PROPERTY(_TARGET_SUPPORTS_SHARED_LIBS
+ GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
+ OPTION(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
+ OPTION(PYTHON_MODULE_${_NAME}_BUILD_SHARED
+ "Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS})
+
+ # Mark these options as advanced
+ MARK_AS_ADVANCED(PYTHON_ENABLE_MODULE_${_NAME}
+ PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+
+ IF(PYTHON_ENABLE_MODULE_${_NAME})
+ IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+ SET(PY_MODULE_TYPE MODULE)
+ ELSE(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+ SET(PY_MODULE_TYPE STATIC)
+ SET_PROPERTY(GLOBAL APPEND PROPERTY PY_STATIC_MODULES_LIST ${_NAME})
+ ENDIF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+
+ SET_PROPERTY(GLOBAL APPEND PROPERTY PY_MODULES_LIST ${_NAME})
+ ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
+# TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
+
+ IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+ SET_TARGET_PROPERTIES(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
+ IF(WIN32 AND NOT CYGWIN)
+ SET_TARGET_PROPERTIES(${_NAME} PROPERTIES SUFFIX ".pyd")
+ ENDIF(WIN32 AND NOT CYGWIN)
+ ENDIF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
+
+ ENDIF(PYTHON_ENABLE_MODULE_${_NAME})
+ENDFUNCTION(PYTHON_ADD_MODULE)
+
+FUNCTION(PYTHON_WRITE_MODULES_HEADER _filename)
+
+ GET_PROPERTY(PY_STATIC_MODULES_LIST GLOBAL PROPERTY PY_STATIC_MODULES_LIST)
+
+ GET_FILENAME_COMPONENT(_name "${_filename}" NAME)
+ STRING(REPLACE "." "_" _name "${_name}")
+ STRING(TOUPPER ${_name} _nameUpper)
+ SET(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename})
+
+ SET(_filenameTmp "${_filename}.in")
+ FILE(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")
+ FILE(APPEND ${_filenameTmp}
+"#ifndef ${_nameUpper}
+#define ${_nameUpper}
+
+#include <Python.h>
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif /* __cplusplus */
+
+")
+
+ FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+ FILE(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")
+ ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+
+ FILE(APPEND ${_filenameTmp}
+"#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+")
+
+
+ FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+ FILE(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")
+ ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+
+ FILE(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n")
+ FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+ FILE(APPEND ${_filenameTmp} " ${_name}_${_currentModule}();\n")
+ ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
+ FILE(APPEND ${_filenameTmp} "}\n\n")
+ FILE(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")
+
+# with CONFIGURE_FILE() cmake complains that you may not use a file created using FILE(WRITE) as input file for CONFIGURE_FILE()
+ EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
+
+ENDFUNCTION(PYTHON_WRITE_MODULES_HEADER)
=== added file 'cmake_modules/FindSWIG.cmake'
--- cmake_modules/FindSWIG.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindSWIG.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,73 @@
+# - Find SWIG
+# This module finds an installed SWIG. It sets the following variables:
+# 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
+#
+# All informations are collected from the SWIG_EXECUTABLE so the
+# version to be found can be changed from the command line by
+# means of setting SWIG_EXECUTABLE
+#
+
+#=============================================================================
+# Copyright 2004-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+SET(SWIG_FOUND FALSE)
+
+FIND_PROGRAM(SWIG_EXECUTABLE swig)
+
+IF(SWIG_EXECUTABLE)
+ EXECUTE_PROCESS(COMMAND ${SWIG_EXECUTABLE} -swiglib
+ OUTPUT_VARIABLE SWIG_swiglib_output
+ ERROR_VARIABLE SWIG_swiglib_error
+ RESULT_VARIABLE SWIG_swiglib_result)
+
+ IF(SWIG_swiglib_result)
+ IF(SWIG_FIND_REQUIRED)
+ MESSAGE(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
+ ELSE(SWIG_FIND_REQUIRED)
+ MESSAGE(STATUS "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
+ ENDIF(SWIG_FIND_REQUIRED)
+ ELSE(SWIG_swiglib_result)
+ STRING(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output})
+ # force the path to be computed each time in case SWIG_EXECUTABLE has changed.
+ SET(SWIG_DIR SWIG_DIR-NOTFOUND)
+ FIND_PATH(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output})
+ IF(SWIG_DIR)
+ SET(SWIG_FOUND 1)
+ SET(SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake)
+ EXECUTE_PROCESS(COMMAND ${SWIG_EXECUTABLE} -version
+ OUTPUT_VARIABLE SWIG_version_output
+ ERROR_VARIABLE SWIG_version_output
+ RESULT_VARIABLE SWIG_version_result)
+ IF(SWIG_version_result)
+ MESSAGE(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -version\" failed with output:\n${SWIG_version_output}")
+ ELSE(SWIG_version_result)
+ STRING(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1"
+ SWIG_version_output "${SWIG_version_output}")
+ SET(SWIG_VERSION ${SWIG_version_output} CACHE STRING "Swig version" FORCE)
+ ENDIF(SWIG_version_result)
+ ENDIF(SWIG_DIR)
+ ENDIF(SWIG_swiglib_result)
+ENDIF(SWIG_EXECUTABLE)
+
+IF(NOT SWIG_FOUND)
+ IF(NOT SWIG_FIND_QUIETLY)
+ IF(SWIG_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "SWIG was not found. Please specify Swig executable location")
+ ELSE(SWIG_FIND_REQUIRED)
+ MESSAGE(STATUS "SWIG was not found. Please specify Swig executable location")
+ ENDIF(SWIG_FIND_REQUIRED)
+ ENDIF(NOT SWIG_FIND_QUIETLY)
+ENDIF(NOT SWIG_FOUND)
=== added file 'cmake_modules/FindTcMalloc.cmake'
--- cmake_modules/FindTcMalloc.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindTcMalloc.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,64 @@
+# 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.
+#
+# - Find Tcmalloc
+# Find the native Tcmalloc includes and library
+#
+# Tcmalloc_INCLUDE_DIR - where to find Tcmalloc.h, etc.
+# Tcmalloc_LIBRARIES - List of libraries when using Tcmalloc.
+# Tcmalloc_FOUND - True if Tcmalloc found.
+
+
+IF (Tcmalloc_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(Tcmalloc_FIND_QUIETLY TRUE)
+ENDIF (Tcmalloc_INCLUDE_DIR)
+
+FIND_PATH(Tcmalloc_INCLUDE_DIR google/heap-checker.h
+ /opt/local/include
+ /usr/local/include
+ /usr/include
+)
+
+SET(Tcmalloc_NAMES tcmalloc)
+FIND_LIBRARY(Tcmalloc_LIBRARY
+ NAMES ${Tcmalloc_NAMES}
+ PATHS /usr/lib /usr/local/lib /opt/local/lib
+)
+
+IF (Tcmalloc_INCLUDE_DIR AND Tcmalloc_LIBRARY)
+ SET(Tcmalloc_FOUND TRUE)
+ SET( Tcmalloc_LIBRARIES ${Tcmalloc_LIBRARY} )
+ELSE (Tcmalloc_INCLUDE_DIR AND Tcmalloc_LIBRARY)
+ SET(Tcmalloc_FOUND FALSE)
+ SET( Tcmalloc_LIBRARIES )
+ENDIF (Tcmalloc_INCLUDE_DIR AND Tcmalloc_LIBRARY)
+
+IF (Tcmalloc_FOUND)
+ IF (NOT Tcmalloc_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Tcmalloc: ${Tcmalloc_LIBRARY}")
+ ENDIF (NOT Tcmalloc_FIND_QUIETLY)
+ELSE (Tcmalloc_FOUND)
+ MESSAGE(STATUS "Not Found Tcmalloc: ${Tcmalloc_LIBRARY}")
+ IF (Tcmalloc_FIND_REQUIRED)
+ MESSAGE(STATUS "Looked for Tcmalloc libraries named ${TcmallocS_NAMES}.")
+ MESSAGE(FATAL_ERROR "Could NOT find Tcmalloc library")
+ ENDIF (Tcmalloc_FIND_REQUIRED)
+ENDIF (Tcmalloc_FOUND)
+
+MARK_AS_ADVANCED(
+ Tcmalloc_LIBRARY
+ Tcmalloc_INCLUDE_DIR
+ )
+
=== added file 'cmake_modules/FindXercesC.cmake'
--- cmake_modules/FindXercesC.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindXercesC.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,54 @@
+# 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.
+
+# - Try to find Xerces-C
+#
+# Once done this will define:
+# XERCESC_FOUND - system has Xerces-C
+# XERCESC_INCLUDE - the Xerces-C include directory
+# XERCESC_LIBRARY - Link these to use Xerces-C
+# XERCESC_VERSION - Xerces-C found version
+
+IF (XERCESC_INCLUDE AND XERCESC_LIBRARY)
+ # in cache already
+ SET(XERCESC_FIND_QUIETLY TRUE)
+ENDIF (XERCESC_INCLUDE AND XERCESC_LIBRARY)
+
+FIND_PATH(
+ XERCESC_INCLUDE
+ NAMES xercesc/util/XercesVersion.hpp
+ PATHS c:/Libs/xerces-c_2_8_0 ${XERCES_INCLUDE_DIR}
+ PATH_SUFFIXES xercesc)
+
+FIND_LIBRARY(
+ XERCESC_LIBRARY
+ NAMES xerces-c xerces-c_2 xerces-c_3
+ PATHS ${XERCES_LIBRARY_DIR})
+
+IF (XERCESC_INCLUDE AND XERCESC_LIBRARY)
+ SET(XERCESC_FOUND TRUE)
+ELSE (XERCESC_INCLUDE AND XERCESC_LIBRARY)
+ SET(XERCESC_FOUND FALSE)
+ENDIF (XERCESC_INCLUDE AND XERCESC_LIBRARY)
+
+IF(XERCESC_FOUND)
+ IF(NOT XERCESC_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Xerces-C: ${XERCESC_LIBRARY}")
+ MESSAGE(STATUS " : ${XERCESC_INCLUDE}")
+ ENDIF(NOT XERCESC_FIND_QUIETLY)
+ELSE(XERCESC_FOUND)
+ MESSAGE(STATUS "Could not find Xerces-C in default locations!")
+ENDIF(XERCESC_FOUND)
+
+MARK_AS_ADVANCED(XERCESC_INCLUDE XERCESC_LIBRARY)
=== added file 'cmake_modules/FindXercesCVersion.cmake'
--- cmake_modules/FindXercesCVersion.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/FindXercesCVersion.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,47 @@
+# 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.
+#
+# - Try to find the version of Xerces-C
+# Expects XERCESC_INCLUDE - the Xerces-C include directory
+#
+# Once done this will define
+#
+# XERCESC_VERSION - Xerces-C found version
+
+FIND_PATH(XVERHPPPATH NAMES XercesVersion.hpp PATHS
+ ${XERCESC_INCLUDE}/xercesc/util NO_DEFAULT_PATH)
+
+IF ( ${XVERHPPPATH} STREQUAL XVERHPPPATH-NOTFOUND )
+ SET(XERCES_VERSION "0")
+ELSE( ${XVERHPPPATH} STREQUAL XVERHPPPATH-NOTFOUND )
+ FILE(READ ${XVERHPPPATH}/XercesVersion.hpp XVERHPP)
+
+ STRING(REGEX MATCH "\n *#define XERCES_VERSION_MAJOR +[0-9]+" XVERMAJ
+ ${XVERHPP})
+ STRING(REGEX MATCH "\n *#define XERCES_VERSION_MINOR +[0-9]+" XVERMIN
+ ${XVERHPP})
+ STRING(REGEX MATCH "\n *#define XERCES_VERSION_REVISION +[0-9]+" XVERREV
+ ${XVERHPP})
+
+ STRING(REGEX REPLACE "\n *#define XERCES_VERSION_MAJOR +" ""
+ XVERMAJ ${XVERMAJ})
+ STRING(REGEX REPLACE "\n *#define XERCES_VERSION_MINOR +" ""
+ XVERMIN ${XVERMIN})
+ STRING(REGEX REPLACE "\n *#define XERCES_VERSION_REVISION +" ""
+ XVERREV ${XVERREV})
+
+ SET(XERCESC_VERSION ${XVERMAJ}.${XVERMIN}.${XVERREV})
+ #MESSAGE(STATUS "Xerces-C Version: ${XERCESC_VERSION}")
+
+ENDIF ( ${XVERHPPPATH} STREQUAL XVERHPPPATH-NOTFOUND )
=== added file 'cmake_modules/GenZorbaRuntime.cmake'
--- cmake_modules/GenZorbaRuntime.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/GenZorbaRuntime.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,150 @@
+# 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.
+
+# This script will either generate a source file from a spec XML file
+# (if Zorba is available to process it), or copy a pre-generated
+# version from svn.
+
+# Arguments - all are required:
+# query: Full path to .xq to execute for generation
+# extvars: List of external variables to bind (-e args to zorba)
+# files: List of files to bind to $files in query
+# gen_file: Full path to generated file (in binary dir)
+# ZORBA_EXE: Full path of ZORBA_EXE
+# binary_dir: Full path of CMAKE_BINARY_DIR
+# source_dir: Full path of CMAKE_SOURCE_DIR
+
+# Optional arguments:
+# test_only: If true, we are testing the generation. Generate to a
+# temp location and fail if the generated file is different than the
+# pre-generated form. Note: gen_file must be provided as normal!
+
+
+# Check if zorbacmd exists and works. We need the ZORBA_EXE and the
+# file API for the generation of the runtime and codegen. Zorba will
+# fail running the test query if the file API dll is not found in the
+# correct location.
+SET (ZORBA_WORKS)
+IF (EXISTS ${ZORBA_EXE})
+ EXECUTE_PROCESS (
+ COMMAND
+ ${ZORBA_EXE}
+ -q "import module namespace file = 'http://expath.org/ns/file'; import module namespace x = 'http://www.zorba-xquery.com/modules/xml'; file:exists( 'a non existant file' )"
+ RESULT_VARIABLE ZORBA_WORKS_RES
+ OUTPUT_VARIABLE ZORBA_WORKS_OUTPUT
+ )
+ IF (NOT ZORBA_WORKS_RES EQUAL 0)
+ SET (ZORBA_WORKS FALSE)
+ MESSAGE (STATUS "[WARNING] Zorba Command Line Utility at \"${ZORBA_EXE}\ "
+ "does not work properly and cannot generate the runtime source files. "
+ "This will cause the repository version of these files to be used. "
+ "(Output from Zorba test command: ${ZORBA_WORKS_OUTPUT}")
+ ELSE (NOT ZORBA_WORKS_RES EQUAL 0)
+ SET (ZORBA_WORKS TRUE)
+ ENDIF (NOT ZORBA_WORKS_RES EQUAL 0)
+ELSE (EXISTS ${ZORBA_EXE})
+ SET (ZORBA_WORKS FALSE)
+ENDIF (EXISTS ${ZORBA_EXE})
+
+# Compute the relative path to the generated file
+FILE(RELATIVE_PATH gen_relfile "${binary_dir}" "${gen_file}")
+GET_FILENAME_COMPONENT(gen_relfiledir "${gen_relfile}" PATH)
+GET_FILENAME_COMPONENT(gen_relfilename "${gen_relfile}" NAME)
+
+# Compute path to pre-generated file.
+SET(pregen_file "${source_dir}/${gen_relfiledir}/pregenerated/${gen_relfilename}")
+
+# If we are testing the generation, overwrite gen_file with a dummy location.
+IF(test_only)
+ STRING(REGEX REPLACE "[/\\]" "_" gen_file "${gen_relfilename}")
+ SET(gen_file "${binary_dir}/test/GenZorbaRuntime/${gen_relfile}")
+ENDIF(test_only)
+
+
+IF(ZORBA_WORKS)
+ MESSAGE(STATUS "Generating: ${gen_file}")
+ SET(extvarargs)
+ FOREACH(extvar ${extvars})
+ LIST(APPEND extvarargs "-e" "${extvar}")
+ ENDFOREACH(extvar)
+ IF(files)
+ # Because semicolons in CMake arguments end up being lists, we
+ # change the delimiter to a comma before passing to Zorba.
+ STRING(REPLACE ";" "," files "${files}")
+ LIST(APPEND extvarargs "-e" "files:=${files}")
+ ENDIF(files)
+ GET_FILENAME_COMPONENT(gen_file_dir "${gen_file}" PATH)
+ FILE(MAKE_DIRECTORY "${gen_file_dir}")
+ EXECUTE_PROCESS(COMMAND "${ZORBA_EXE}"
+ -q "${query}"
+ -f
+ -o "${gen_file}"
+ ${extvarargs}
+ --serialize-text
+ WORKING_DIRECTORY "${source_dir}/src/runtime/spec"
+ RESULT_VARIABLE RESULT)
+ IF(RESULT)
+ # Zorba may have created an empty file first, which will mess up dependency checking
+ FILE(REMOVE "${gen_file}")
+ MESSAGE(FATAL_ERROR "Error during generation!")
+ ENDIF(RESULT)
+
+ IF(test_only)
+ # Compare the resulting file with the existing pre-generated file.
+ # This SHOULD be the same, because either:
+
+ # A. Zorba existed before this bulid, in which case the
+ # pre-generated files would have been generated and overwritten if
+ # there were any spec file changes.
+
+ # B. Zorba did not exist before thie build, in which case the
+ # pre-generated files should match the results of generating now
+ # as they should be in sync in svn with the spec files.
+
+ # If they DON'T match, either somebody checked in a spec file that
+ # is no longer in sync with the pre-generated source; or somebody
+ # checked in something that affected the generation process
+ # without performing a re-generation. In either case, we want this
+ # test to fail!
+ EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" "-E" "compare_files"
+ "${pregen_file}" "${gen_file}" RESULT_VARIABLE COMPARE_RES)
+ IF(COMPARE_RES)
+ MESSAGE(FATAL_ERROR "Runtime generation produced different file! "
+ "Result was: ${COMPARE_RES} for ${pregen_file}")
+ ENDIF(COMPARE_RES)
+ ELSE(test_only)
+ # Overwrite the pregenerated file, so svn will pick it up. Use
+ # copy_if_different so we don't mess with the timestamps if there
+ # was no difference.
+ EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" "-E" "copy_if_different"
+ "${gen_file}" "${pregen_file}")
+ ENDIF(test_only)
+
+ELSE(ZORBA_WORKS)
+
+ IF(test_only)
+ MESSAGE(FATAL_ERROR "Attempt to test runtime generation with "
+ "non-functional or missing Zorba executable ${ZORBA_EXE}!")
+ ELSE(test_only)
+ MESSAGE(STATUS "Copying pregenerated file for ${gen_file}")
+ EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" "-E" "copy"
+ "${pregen_file}" "${gen_file}")
+ ENDIF(test_only)
+
+ENDIF(ZORBA_WORKS)
+
+# Clean up testing file if we got this far
+IF(test_only)
+ FILE(REMOVE "${gen_file}")
+ENDIF(test_only)
=== added file 'cmake_modules/VCProject.vcproj.in'
--- cmake_modules/VCProject.vcproj.in 1970-01-01 00:00:00 +0000
+++ cmake_modules/VCProject.vcproj.in 2013-08-27 22:37:07 +0000
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<!--
+:: 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.
+::
+-->
+ <VisualStudioUserFile>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ >
+ <DebugSettings
+ Environment="PATH=@WIN_CMAKE_BINARY_DIR@\src\Debug;@ZORBA_REQUIRED_DLLS_PATH_NATIVE@;%PATH%"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ >
+ <DebugSettings
+ Environment="PATH=@WIN_CMAKE_BINARY_DIR@\src\Release;@ZORBA_REQUIRED_DLLS_PATH_NATIVE@;%PATH%"
+ />
+ </Configuration>
+ <Configuration
+ Name="MinSizeRel|Win32"
+ >
+ <DebugSettings
+ Environment="PATH=@WIN_CMAKE_BINARY_DIR@\src\MinSizeRel;@ZORBA_REQUIRED_DLLS_PATH_NATIVE@;%PATH%"
+ />
+ </Configuration>
+ <Configuration
+ Name="RelWithDebInfo|Win32"
+ >
+ <DebugSettings
+ Environment="PATH=@WIN_CMAKE_BINARY_DIR@\src\RelWithDebInfo;@ZORBA_REQUIRED_DLLS_PATH_NATIVE@;%PATH%"
+ />
+ </Configuration>
+ <!-- Rest of Configurations -->
+ </Configurations>
+</VisualStudioUserFile>
=== added directory 'cmake_modules/Windows'
=== added file 'cmake_modules/Windows/FindCSharp.cmake'
--- cmake_modules/Windows/FindCSharp.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindCSharp.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,90 @@
+# Copyright 2010 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.
+
+FILE(TO_CMAKE_PATH "$ENV{WINDIR}" windir)
+SET(framework_version "$ENV{FrameworkVersion}")
+
+SET(csc_search_paths
+ "${windir}/Microsoft.NET/Framework/v2.0.50727"
+ "${windir}/Microsoft.NET/Framework/v3.5"
+ "${windir}/Microsoft.NET/Framework/v3.0"
+ )
+
+IF(CMAKE_GENERATOR MATCHES "Visual Studio 9 2008")
+ SET(csc_search_paths
+ "${windir}/Microsoft.NET/Framework/v3.5"
+ "${windir}/Microsoft.NET/Framework/v3.0"
+ "${windir}/Microsoft.NET/Framework/v2.0.50727"
+ )
+ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 9 2008")
+
+IF(CMAKE_GENERATOR MATCHES "Visual Studio 10")
+ SET(csc_search_paths
+ "${windir}/Microsoft.NET/Framework/v4.0.30128"
+ "${windir}/Microsoft.NET/Framework/v3.5"
+ "${windir}/Microsoft.NET/Framework/v3.0"
+ "${windir}/Microsoft.NET/Framework/v2.0.50727"
+ )
+ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 10")
+
+FIND_PROGRAM(csc_EXECUTABLE "csc"
+ ${csc_search_paths}
+ "${windir}/Microsoft.NET/Framework/${framework_version}"
+ "${windir}/Microsoft.NET/Framework/v1.1.4322"
+ "${windir}/Microsoft.NET/Framework/v1.0.3705"
+ NO_DEFAULT_PATH
+ )
+
+IF(NOT csc_EXECUTABLE)
+ FIND_PROGRAM(csc_EXECUTABLE NAMES "csc" "gmcs")
+ENDIF(NOT csc_EXECUTABLE)
+
+FIND_PROGRAM(mono_EXECUTABLE "mono")
+
+GET_FILENAME_COMPONENT(csc_DIR "${csc_EXECUTABLE}" PATH)
+
+SET(CSC_ACCEPTS_PLATFORM_FLAG 0)
+SET(CSC_COMPILES_PARTIAL_CLASSES 0)
+
+IF(csc_EXECUTABLE)
+ EXECUTE_PROCESS(COMMAND "${csc_EXECUTABLE}" "/?" OUTPUT_VARIABLE CSC_HELP)
+
+ IF("${CSC_HELP}" MATCHES "/platform:<string>")
+ SET(CSC_ACCEPTS_PLATFORM_FLAG 1)
+ SET(CSC_COMPILES_PARTIAL_CLASSES 1)
+ ENDIF("${CSC_HELP}" MATCHES "/platform:<string>")
+ENDIF(csc_EXECUTABLE)
+
+IF(NOT DEFINED CSC_PLATFORM_FLAG)
+ SET(CSC_PLATFORM_FLAG "")
+ IF(CSC_ACCEPTS_PLATFORM_FLAG)
+ SET(CSC_PLATFORM_FLAG "/platform:x86")
+ IF("${CMAKE_SIZEOF_VOID_P}" GREATER 4)
+ SET(CSC_PLATFORM_FLAG "/platform:x64")
+ ENDIF("${CMAKE_SIZEOF_VOID_P}" GREATER 4)
+ ENDIF(CSC_ACCEPTS_PLATFORM_FLAG)
+ENDIF(NOT DEFINED CSC_PLATFORM_FLAG)
+
+IF(NOT DEFINED CSC_DEBUG_FLAG)
+ SET(CSC_DEBUG_FLAG "")
+ IF("${CMAKE_BUILD_TYPE}" MATCHES "Debug|RelWithDebInfo")
+ SET(CSC_DEBUG_FLAG "/debug")
+ ENDIF("${CMAKE_BUILD_TYPE}" MATCHES "Debug|RelWithDebInfo")
+ IF("${BUILDNAME}" MATCHES "Debug|RelWithDebInfo")
+ SET(CSC_DEBUG_FLAG "/debug")
+ ENDIF("${BUILDNAME}" MATCHES "Debug|RelWithDebInfo")
+ IF("${CMAKE_BINARY_DIR}" MATCHES "Debug|RelWithDebInfo")
+ SET(CSC_DEBUG_FLAG "/debug")
+ ENDIF("${CMAKE_BINARY_DIR}" MATCHES "Debug|RelWithDebInfo")
+ENDIF(NOT DEFINED CSC_DEBUG_FLAG)
=== added file 'cmake_modules/Windows/FindCURL.cmake'
--- cmake_modules/Windows/FindCURL.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindCURL.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,59 @@
+# Copyright 2010 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.
+
+# - Find the native cURL headers and libraries on Windows
+#
+# This is a proxy module that calls the FindCURL.cmake module shipped with
+# CMake. But before we try to guess where cURL might be on the user's machine.
+# The user should provide ZORBA_THIRD_PARTY_REQUIREMENTS which is a path where
+# the cURL directory can be found. The cURL directory must have "curl"
+# (case insensitive) in its name.
+#
+# This module helps the Windows user to avoid providing the following two
+# variables when building Zorba:
+# -D CURL_INCLUDE_DIR="path_to_3rd_party_dir\*curl*\include"
+# -D CURL_LIBRARY="path_to_3rd_party_dir\*curl*\libcurl_imp.lib"
+#
+# See the FindCURL.cmake module shipped with CMake for more information.
+
+FIND_PACKAGE_WIN32(NAME "CURL" FOUND_VAR "CURL_FOUND" SEARCH_NAMES "curl")
+
+IF (CURL_FOUND)
+
+ IF (EXISTS "${FOUND_LOCATION}/curl.exe")
+
+ MESSAGE (STATUS "Found CURL binary distribution")
+
+ # find the needed DLL's
+ FIND_PACKAGE_DLL_WIN32 (${FOUND_LOCATION} "libcurl" "curllib")
+ FIND_PACKAGE_DLL_WIN32 (${FOUND_LOCATION} "libeay32")
+ FIND_PACKAGE_DLL_WIN32 (${FOUND_LOCATION} "openldap")
+ FIND_PACKAGE_DLL_WIN32 (${FOUND_LOCATION} "ssleay32")
+ FIND_PACKAGE_DLL_WIN32 (${FOUND_LOCATION} "libsasl")
+
+ ELSE (EXISTS "${FOUND_LOCATION}/curl.exe")
+
+ MESSAGE (STATUS "Found CURL source build")
+
+ # find the needed DLL's
+ FIND_PACKAGE_DLL_WIN32 (${FOUND_LOCATION} "libcurl" "curllib")
+
+ # find additional DLL's
+ FIND_DLL_WIN32 ("libeay32.dll")
+ FIND_DLL_WIN32 ("ssleay32.dll")
+ #FIND_DLL_WIN32 (libsasl.dll)
+
+ ENDIF (EXISTS "${FOUND_LOCATION}/curl.exe")
+
+ENDIF (CURL_FOUND)
=== added file 'cmake_modules/Windows/FindICU.cmake'
--- cmake_modules/Windows/FindICU.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindICU.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,80 @@
+# Copyright 2010 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.
+
+# - Find the International Components for Unicode (ICU) Library on Windows
+#
+# This is a proxy module that calls the FindICU.cmake module. Before
+# doing that, we try to guess where ICU might be on the user's machine.
+# The user should provide ZORBA_THIRD_PARTY_REQUIREMENTS which is a path where
+# a the ICU directory can be found. The ICU directory must have "icu"
+# (case insensitive) in its name.
+#
+# This module helps the Windows user to avoid providing the following two
+# variables when building Zorba:
+# -D ICU_LIBRARY="path_to_3rd_party_dir\*icu*\lib\icuuc.lib"
+# -D ICU_DATA_LIBRARY="path_to_3rd_party_dir\*icu*\lib\icudt.lib"
+# -D ICU_I18N_LIBRARY="path_to_3rd_party_dir\*icu*\lib\icuin.lib"
+# -D ICU_INCLUDE="path_to_3rd_party_dir\*icu*\include"
+#
+# See the FindICU.cmake module shipped with Zorba for more information.
+
+FIND_PACKAGE_WIN32 (NAME ICU FOUND_VAR ICU_FOUND SEARCH_NAMES icu)
+
+IF (ICU_FOUND)
+
+ # first delete the cache entry for DLL to make sure the correct one is chosen
+ UNSET (ICU_INFO_EXE CACHE)
+
+ # find ICU version
+ FIND_PATH (
+ ICU_INFO_EXE_PATH
+ icuinfo.exe
+ PATHS "${FOUND_LOCATION}"
+ # add more suffixes if necessary
+ PATH_SUFFIXES "bin" "bin/Release"
+ NO_DEFAULT_PATH
+ )
+
+ IF (NOT ICU_INFO_EXE_PATH)
+
+ MESSAGE (WARNING "icuinfo.exe was not found in: ${FOUND_LOCATION}. This is needed in order to retrieve the ICU version and to find the ICU DLLs. Zorba will not run unless you have the ICU DLLs in the path.")
+
+ ELSE (NOT ICU_INFO_EXE_PATH)
+
+ EXECUTE_PROCESS (COMMAND "${ICU_INFO_EXE_PATH}/icuinfo.exe" OUTPUT_VARIABLE INFO)
+ STRING (REGEX REPLACE "\n" ";" LINES ${INFO})
+ FOREACH (LINE ${LINES})
+ IF (LINE MATCHES "Runtime-Version: ")
+ STRING (REPLACE "Runtime-Version: " "" VERSION ${LINE})
+ ENDIF (LINE MATCHES "Runtime-Version: ")
+ ENDFOREACH (LINE)
+
+ STRING (REPLACE "." ";" PARTS ${VERSION})
+
+ LIST (GET PARTS 0 MAJOR_VERSION)
+ LIST (GET PARTS 1 MINOR_VERSION)
+ SET (DLL_VERSION "${MAJOR_VERSION}${MINOR_VERSION}")
+
+ SET (DLL_NAMES
+ "icudt${DLL_VERSION}.dll"
+ "icuin${DLL_VERSION}.dll"
+ "icuuc${DLL_VERSION}.dll"
+ )
+
+ # find the needed DLL's
+ FIND_PACKAGE_DLLS_WIN32 (${ICU_INFO_EXE_PATH} "${DLL_NAMES}")
+
+ ENDIF (NOT ICU_INFO_EXE_PATH)
+
+ENDIF (ICU_FOUND)
=== added file 'cmake_modules/Windows/FindIconv.cmake'
--- cmake_modules/Windows/FindIconv.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindIconv.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,37 @@
+# Copyright 2010 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.
+
+# - Try to find Iconv on Windows
+#
+# This is a proxy module that calls the FindIconv.cmake module. Before
+# doing that, we try to guess where Iconv might be on the user's machine.
+# The user should provide ZORBA_THIRD_PARTY_REQUIREMENTS which is a path where
+# the LibTidy directory can be found. The Iconv directory must have "iconv"
+# (case insensitive) in its name.
+#
+# This module helps the Windows user to avoid providing the following two
+# variables when building Zorba:
+# -D ICONV_INCLUDE_DIR="path_to_3rd_party_dir\*iconv*\include"
+# -D ICONV_LIBRARY="path_to_3rd_party_dir\*iconv*\lib\iconv.lib"
+#
+# See the FindIconv.cmake module shipped with Zorba for more information.
+
+FIND_PACKAGE_WIN32 (NAME Iconv FOUND_VAR ICONV_FOUND SEARCH_NAMES iconv)
+
+IF (ICONV_FOUND)
+
+ # find the needed DLL's
+ FIND_PACKAGE_DLLS_WIN32 (${FOUND_LOCATION} iconv.dll)
+
+ENDIF (ICONV_FOUND)
=== added file 'cmake_modules/Windows/FindLibXml2.cmake'
--- cmake_modules/Windows/FindLibXml2.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindLibXml2.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,37 @@
+# Copyright 2010 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.
+
+# - Try to find the LibXml2 xml processing library on Windows
+#
+# This is a proxy module that calls the FindLibXml2.cmake module shipped with
+# CMake. But before we try to guess where LibXml2 might be on the user's machine,
+# the user should provide ZORBA_THIRD_PARTY_REQUIREMENTS which is a path where
+# the LibXml2 directory can be found. The LibXml2 directory must have "libxml"
+# (case insensitive) in its name.
+#
+# This module helps the Windows user to avoid providing the following two
+# variables when building Zorba:
+# -D LIBXML2_INCLUDE_DIR="path_to_3rd_party_dir\*libxml*\include"
+# -D LIBXML2_LIBRARIES="path_to_3rd_party_dir\*libxml*\lib\libxml2.lib"
+#
+# See the FindLibXml2.cmake module shipped with CMake for more information.
+
+FIND_PACKAGE_WIN32 (NAME "LibXml2" FOUND_VAR "LIBXML2_FOUND" SEARCH_NAMES "libxml")
+
+IF (LIBXML2_FOUND)
+
+ # find the needed DLL's
+ FIND_PACKAGE_DLLS_WIN32 (${FOUND_LOCATION} libxml2.dll)
+
+ENDIF (LIBXML2_FOUND)
=== added file 'cmake_modules/Windows/FindLibXslt.cmake'
--- cmake_modules/Windows/FindLibXslt.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindLibXslt.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,37 @@
+# Copyright 2010 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.
+
+# - Try to find the LIBXSLT lib on Windows
+#
+# This is a proxy module that calls the FindLibXslt.cmake module. Before
+# doing that, we try to guess where LIBXSLT might be on the user's machine.
+# The user should provide ZORBA_THIRD_PARTY_REQUIREMENTS which is a path where
+# the LIBXSLT directory can be found. The LIBXSLT directory must have "libxslt"
+# (case insensitive) in its name.
+#
+# This module helps the Windows user to avoid providing the following two
+# variables when building Zorba:
+# -D LIBXSLT_INCLUDE="path_to_3rd_party_dir\*LIBXSLT*\src"
+# -D LIBXSLT_LIBRARY="path_to_3rd_party_dir\*LIBXSLT*\bin\[Release\]libxslt.lib"
+#
+# See the FindLibTidy.cmake module shipped with Zorba for more information.
+
+FIND_PACKAGE_WIN32(NAME LibXslt FOUND_VAR LIBXSLT_FOUND SEARCH_NAMES libxslt)
+
+IF (LIBXSLT_FOUND)
+
+ # find the needed DLL's
+ FIND_PACKAGE_DLLS_WIN32 (${FOUND_LOCATION} libxslt.dll)
+
+ENDIF (LIBXSLT_FOUND)
=== added file 'cmake_modules/Windows/FindPHP5.cmake'
--- cmake_modules/Windows/FindPHP5.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindPHP5.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,19 @@
+# Copyright 2010 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.
+
+# - Find PHP on Windows
+#
+# TODO: correct description missing
+
+FIND_PACKAGE_WIN32(NAME PHP5 FOUND_VAR PHP5_FOUND SEARCH_NAMES php)
=== added file 'cmake_modules/Windows/FindPythonInterp.cmake'
--- cmake_modules/Windows/FindPythonInterp.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindPythonInterp.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,29 @@
+# Copyright 2010 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.
+
+# - Try to find the Python interpreter on Windows
+#
+# This is a proxy module that calls the FindPythonInterp.cmake module shipped with
+# CMake. But before we try to guess where Python interpreter might be on the user's
+# machine, the user should provide ZORBA_THIRD_PARTY_REQUIREMENTS which is a list
+# of paths where the Python interpreter directory can be found. The Python
+# interpreter directory must have "python" (case insensitive) in its name.
+#
+# This module helps the Windows user to avoid providing the following two
+# variables when building Zorba:
+# -D PYTHON_EXECUTABLE="path_to_3rd_party_dir\*python*\python.exe"
+#
+# See the FindPythonInterp.cmake module shipped with CMake for more information.
+
+FIND_PACKAGE_WIN32 (NAME PythonInterp FOUND_VAR PYTHONINTERP_FOUND SEARCH_NAMES python)
=== added file 'cmake_modules/Windows/FindPythonLibs.cmake'
--- cmake_modules/Windows/FindPythonLibs.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindPythonLibs.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,30 @@
+# Copyright 2010 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.
+
+# - Try to find the Python include files and libraries on Windows
+#
+# This is a proxy module that calls the FindPythonLibs.cmake module shipped with
+# CMake. But before we try to guess where the Python libraries might be on the
+# user's machine, the user should provide ZORBA_THIRD_PARTY_REQUIREMENTS which
+# is a list of paths where the Python directory can be found. The Python
+# directory must have "python" (case insensitive) in its name.
+#
+# This module helps the Windows user to avoid providing the following two
+# variables when building Zorba:
+# -D PYTHON_LIBRARIES="path_to_3rd_party_dir\*python*\lib"
+# -D PYTHON_INCLUDE_DIRS="path_to_3rd_party_dir\*python*\include"
+#
+# See the FindPythonLibs.cmake module shipped with CMake for more information.
+
+FIND_PACKAGE_WIN32 (NAME PythonLibs FOUND_VAR PYTHONLIBS_FOUND SEARCH_NAMES python)
=== added file 'cmake_modules/Windows/FindSWIG.cmake'
--- cmake_modules/Windows/FindSWIG.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindSWIG.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,29 @@
+# Copyright 2010 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.
+
+# - Try to find the SWIG library on Windows
+#
+# This is a proxy module that calls the FindSWIG.cmake module.
+# But before we try to guess where SWIG might be on the user's machine.
+# The user should provide ZORBA_THIRD_PARTY_REQUIREMENTS which is a path where
+# the SWIG directory can be found. The SWIG directory must have "swig"
+# (case insensitive) in its name.
+#
+# This module helps the Windows user to avoid providing the following two
+# variables when building Zorba:
+# -D SWIG_EXECUTABLE="path_to_3rd_party_dir\*swig*\include"
+#
+# See the FindSWIG.cmake module shipped with Zorba for more information.
+
+FIND_PACKAGE_WIN32(NAME SWIG FOUND_VAR SWIG_FOUND SEARCH_NAMES swig)
=== added file 'cmake_modules/Windows/FindXercesC.cmake'
--- cmake_modules/Windows/FindXercesC.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindXercesC.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,50 @@
+# Copyright 2010 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.
+
+# - Try to find Xerces-C on Windows
+#
+# This is a proxy module that calls the FindXercesC.cmake module. Before
+# doing that, we try to guess where XercesC might be on the user's machine.
+# The user should provide ZORBA_THIRD_PARTY_REQUIREMENTS which is a path where
+# the XercesC directory can be found. The XercesC directory must have "xerces"
+# (case insensitive) in its name.
+#
+# This module helps the Windows user to avoid providing the following two
+# variables when building Zorba:
+# -D XERCESC_INCLUDE="path_to_3rd_party_dir\*xerces*\include"
+# -D XERCESC_LIBRARY="path_to_3rd_party_dir\*xerces*\lib\xerces-c_3.lib"
+#
+# See the FindXercesC.cmake module shipped with Zorba for more information.
+
+FIND_PACKAGE_WIN32(NAME XercesC FOUND_VAR XERCESC_FOUND SEARCH_NAMES xerces)
+
+IF (XERCESC_FOUND)
+
+ FILE (GLOB_RECURSE XDLLS RELATIVE "${FOUND_LOCATION}" "${FOUND_LOCATION}/*.dll")
+ SET(REGEX ".*/(xerces-c_._.\\.dll)")
+ FOREACH (DLL ${XDLLS})
+ IF (DLL MATCHES ${REGEX})
+ STRING(REGEX REPLACE "(.*)/xerces-c_._.\\.dll$" "\\1" XERCES_DLL_PATH ${DLL})
+ STRING(REGEX REPLACE ".*/(xerces-c_._.\\.dll)$" "\\1" XERCES_DLL_NAME ${DLL})
+ BREAK ()
+ ENDIF (DLL MATCHES ${REGEX})
+ ENDFOREACH (DLL)
+
+ # just add the found DLL
+ ADD_DLL_WIN32 ("${FOUND_LOCATION}/${XERCES_DLL_PATH}" ${XERCES_DLL_NAME})
+
+ # find additional DLL's
+ FIND_DLL_WIN32 (zlib1.dll)
+
+ENDIF (XERCESC_FOUND)
=== added file 'cmake_modules/Windows/ProxyFindModule.cmake'
--- cmake_modules/Windows/ProxyFindModule.cmake 1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/ProxyFindModule.cmake 2013-08-27 22:37:07 +0000
@@ -0,0 +1,477 @@
+# Copyright 2010 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.
+
+IF (NOT WIN32)
+ MESSAGE (FATAL_ERROR "This module is intended only for Windows platforms.")
+ENDIF (NOT WIN32)
+
+
+MACRO (GET_STARS VAR_NAME)
+ SET (${VAR_NAME} "****************************************")
+ENDMACRO (GET_STARS)
+
+
+MACRO (PRINT_FIND_END_TITLE MODULE_NAME LOCATION_VAR)
+ IF (${LOCATION_VAR})
+ MESSAGE (STATUS "************* DONE (found) *************")
+ MESSAGE (STATUS "Using ${MODULE_NAME} from: ${${LOCATION_VAR}}")
+ ELSE (${LOCATION_VAR})
+ MESSAGE (STATUS "*********** DONE (not found) ***********")
+ ENDIF (${LOCATION_VAR})
+ENDMACRO (PRINT_FIND_END_TITLE)
+
+
+MACRO (PRINT_FIND_END_TITLE_SYSTEM MODULE_NAME FOUND)
+ IF (${FOUND})
+ MESSAGE (STATUS "************* DONE (found) *************")
+ ELSE (${FOUND})
+ MESSAGE (STATUS "*********** DONE (not found) ***********")
+ ENDIF (${FOUND})
+ENDMACRO (PRINT_FIND_END_TITLE_SYSTEM)
+
+
+MACRO (INSTALL_DLL DLL_PATH)
+ IF (${PROJECT_NAME} STREQUAL "zorba")
+ # for zorba core requirements, install this DLL
+ INSTALL (PROGRAMS ${DLL_PATH} DESTINATION bin)
+ ELSE (${PROJECT_NAME} STREQUAL "zorba")
+ # for zorba non-core requirements, install this DLL only if the component is spcified
+ STRING (REPLACE "-" "_" component_name ${PROJECT_NAME})
+ INSTALL (PROGRAMS ${DLL_PATH} DESTINATION bin COMPONENT ${component_name})
+ ENDIF (${PROJECT_NAME} STREQUAL "zorba")
+ENDMACRO (INSTALL_DLL)
+
+
+MACRO (PRINT_FIND_TITLE MODULE_NAME)
+ GET_STARS ("STARS")
+ STRING (LENGTH "${STARS}" STARSLEN)
+ STRING (LENGTH "Zorba Find${MODULE_NAME}" TITLELEN)
+ MATH (EXPR LEN "(${STARSLEN} - ${TITLELEN} - 2) / 2")
+ STRING (SUBSTRING ${STARS} 0 ${LEN} PRESTARS)
+ SET (POSTSTARS ${PRESTARS})
+ MATH (EXPR TOTALLEN "${TITLELEN} + (${LEN} * 2) + 2")
+ IF (NOT(TOTALLEN EQUAL STARSLEN))
+ SET (POSTSTARS "${PRESTARS}*")
+ ENDIF (NOT(TOTALLEN EQUAL STARSLEN))
+
+ MESSAGE (STATUS "${STARS}")
+ MESSAGE (STATUS "${PRESTARS} Zorba Find${MODULE_NAME} ${POSTSTARS}")
+ MESSAGE (STATUS "${STARS}")
+ENDMACRO (PRINT_FIND_TITLE MODULE_NAME)
+
+
+# This macro will try to find a third party library on Windows.
+# The parameters must be given the arguments using the following pattern:
+# PARAM_NAME1 param_value1 PARAM_NAME2 param_value1 param_value2 ...
+# This macro will further call PARSE_ARGUMENTS to parse it's arguments.
+# In the patter above, PARAM_NAME1 will go in the single value parameter pool
+# while PARAM_NAME2 will go in the multiple value parameter pool.
+#
+# Therefore the following parameter names must be provided to this macro:
+# Parameters:
+# NAME
+# - mandatory, single value
+# - the value following it will be used to build the CMake module file name.
+# - e.g.: providing NAME "ICU" as parameters, FindICU.cmake will be used for the search.
+# FOUND_VAR
+# - mandatory, single value
+# - the variable that the FindXXX.cmake module sets if the library is found
+# - e.g.: FOUND_VAR "XERCESC_FOUND" when trying to find XercesC
+# SEARCH_NAMES
+# - mandatory, multiple value
+# - the possible directory name fragments that this library can have
+# - e.g.: SEARCH_NAMES "icu" "i_c_u" "uci"
+# COMPONENTS
+# - optional, multiple value
+#
+# Once done this will define:
+# FOUND_LOCATION - The directory where the library was found
+#
+MACRO (FIND_PACKAGE_WIN32)
+
+ IF (NOT WIN32)
+ MESSAGE (FATAL_ERROR "This macro is intended only for Windows platforms.")
+ ENDIF (NOT WIN32)
+
+ PARSE_ARGUMENTS(MODULE "SEARCH_NAMES;COMPONENTS" "NAME;FOUND_VAR" "" ${ARGN})
+
+ IF(NOT MODULE_NAME)
+ MESSAGE (FATAL_ERROR "'NAME' argument is required")
+ ENDIF(NOT MODULE_NAME)
+ IF(NOT MODULE_FOUND_VAR)
+ MESSAGE (FATAL_ERROR "'FOUND_VAR' argument is required")
+ ENDIF(NOT MODULE_FOUND_VAR)
+ IF(NOT MODULE_SEARCH_NAMES)
+ MESSAGE (FATAL_ERROR "'SEARCH_NAMES' argument is required")
+ ENDIF(NOT MODULE_SEARCH_NAMES)
+
+ PRINT_FIND_TITLE (${MODULE_NAME})
+
+ # reset the output variable where the target library is found
+ SET (FOUND_LOCATION)
+
+ # if not already provided add the program files directory
+ SET (SEARCH_PATHS ${ZORBA_THIRD_PARTY_REQUIREMENTS})
+ LIST (FIND SEARCH_PATHS "$ENV{ProgramFiles}" PRORAM_FILES_FOUND)
+ IF (PRORAM_FILES_FOUND EQUAL -1)
+ SET (SEARCH_PATHS "${SEARCH_PATHS}" "$ENV{ProgramFiles}")
+ ENDIF (PRORAM_FILES_FOUND EQUAL -1)
+
+ SET (PATH_REGEX)
+ FOREACH (PATH ${SEARCH_PATHS})
+ FILE (TO_CMAKE_PATH "${PATH}" PATH)
+ FOREACH (NAME ${MODULE_SEARCH_NAMES})
+ SET (PATH_REGEX ${PATH_REGEX} "${PATH}/*${NAME}*")
+ ENDFOREACH (NAME)
+ ENDFOREACH (PATH)
+
+ # search the SEARCH_PATHS for folders containing one of the names in SEARCH_NAMES
+ FILE (GLOB MATCHED_DIRS ${PATH_REGEX})
+
+ # the list to gather all the prefix paths to be searched
+ SET (LIST_CMAKE_PREFIX_PATH)
+
+ # the list of found directories will be added to the paths LIST_CMAKE_PREFIX_PATH and
+ # thus will be used by the real Find${MODULE_NAME}.cmake module
+ FOREACH (DIR ${MATCHED_DIRS})
+ MESSAGE (STATUS "${MODULE_NAME} will be searched for in: [ZORBA_THIRD_PARTY_REQUIREMENTS] ${DIR}")
+ SET (LIST_CMAKE_PREFIX_PATH ${LIST_CMAKE_PREFIX_PATH} ${DIR})
+ ENDFOREACH (DIR)
+
+ # add all the paths from the PATH environment variable that contain one of the names in SEARCH_NAMES
+ FOREACH (PATH $ENV{PATH})
+ FILE (TO_CMAKE_PATH "${PATH}" PATH)
+ STRING (TOLOWER "${PATH}" LC_PATH)
+
+ # now iterate over all the possible names
+ FOREACH (NAME ${MODULE_SEARCH_NAMES})
+ STRING (TOLOWER "${NAME}" LC_NAME)
+ IF ("${LC_PATH}" MATCHES ".*${LC_NAME}.*")
+ IF (EXISTS "${PATH}/include")
+ MESSAGE (STATUS "${MODULE_NAME} will be searched for in: [PATH environment variable] ${PATH}")
+ SET (LIST_CMAKE_PREFIX_PATH ${LIST_CMAKE_PREFIX_PATH} ${PATH})
+ ELSEIF (EXISTS "${PATH}/../include")
+ MESSAGE (STATUS "${MODULE_NAME} will be searched for in: [PATH environment variable] ${PATH}/..")
+ SET (LIST_CMAKE_PREFIX_PATH ${LIST_CMAKE_PREFIX_PATH} ${PATH}/..)
+ ENDIF (EXISTS "${PATH}/include")
+ ENDIF ("${LC_PATH}" MATCHES ".*${LC_NAME}.*")
+ ENDFOREACH (NAME)
+ ENDFOREACH (PATH)
+
+ # print some help
+ IF (NOT LIST_CMAKE_PREFIX_PATH)
+ MESSAGE (STATUS "No candidate ${MODULE_NAME} directory was found in the paths: ${SEARCH_PATHS};%PATH%")
+ MESSAGE (STATUS "You might want to check the following:")
+ MESSAGE (STATUS " 1. Did you set ZORBA_THIRD_PARTY_REQUIREMENTS properly?")
+ MESSAGE (STATUS " 2. Is your ${MODULE_NAME} directory matching one of the search names: ${SEARCH_NAMES} ?")
+ MESSAGE (STATUS " 3. Is ${MODULE_NAME} or its \"bin\" directory in the PATH environment variable?")
+ ENDIF (NOT LIST_CMAKE_PREFIX_PATH)
+
+ # remove the Windows module path (both from Zorba or the external modules)
+ # to avoid an infinite recursion
+ FOREACH (PATH ${CMAKE_MODULE_PATH})
+ IF ("${PATH}" MATCHES ".*/cmake_modules/Windows")
+ LIST (REMOVE_ITEM CMAKE_MODULE_PATH "${PATH}")
+ ENDIF ("${PATH}" MATCHES ".*/cmake_modules/Windows")
+ ENDFOREACH (PATH)
+
+ # before we start searching, we save the old CMAKE_PREFIX_PATH
+ SET (OLD_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH})
+
+ # now try to find the module for each path in LIST_CMAKE_PREFIX_PATH
+ FOREACH(PATH ${LIST_CMAKE_PREFIX_PATH})
+