<commit_before># 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.
#
# Project name
#
PROJECT(zorba)
ENABLE_TESTING()
INCLUDE(CTest)

# 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 debug
IF(NOT CMAKE_BUILD_TYPE)
  SET(CMAKE_BUILD_TYPE Debug CACHE STRING
      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
      FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)

################################################################################
# Variables
SET(requiredlibs)
SET(DEFINITIONS)

##################################################### Setup Compiler Options
INCLUDE(CMakeCompiler.txt)


################################################################################
# Used libraries

SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)

#####################################################  ICU
INCLUDE(cmake_modules/FindICU.cmake)
IF (NOT ICU_FOUND OR NOT ICU_I18N_FOUND OR NOT ICU_DATA_FOUND)
	MESSAGE(FATAL_ERROR "The ICU library is required in order to build Zorba.")
ELSE (NOT ICU_FOUND OR NOT ICU_I18N_FOUND OR NOT ICU_DATA_FOUND)
    SET(requiredlibs ${requiredlibs} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES} ${ICU_DATA_LIBRARIES})
    INCLUDE_DIRECTORIES(${ICU_INCLUDE_DIRS})
ENDIF (NOT ICU_FOUND OR NOT ICU_I18N_FOUND OR NOT ICU_DATA_FOUND)

#####################################################  LibXml2
FIND_PACKAGE(LibXml2)
IF(LIBXML2_FOUND)
    INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
    SET(requiredlibs ${requiredlibs} ${LIBXML2_LIBRARIES})
    SET(CXXFLAGS ${CXXFLAGS} ${LIBXML2_DEFINITONS})
ELSE(LIBXML2_FOUND)
    MESSAGE(FATAL_ERROR "The libxml2 library is required in order to build Zorba.")
ENDIF(LIBXML2_FOUND)

#####################################################  cURL    
FIND_PACKAGE(CURL)
IF(CURL_FOUND)
  MESSAGE(STATUS "Found cURL library -- " ${CURL_LIBRARIES})
  SET(requiredlibs ${requiredlibs} ${CURL_LIBRARIES})  
  INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
ELSE(CURL_FOUND)
  MESSAGE(STATUS "The cURL library was not found.")
ENDIF(CURL_FOUND)

#####################################################  Iconv
INCLUDE(cmake_modules/FindIconv.cmake)
FIND_PACKAGE(Iconv)
IF (Iconv_FOUND)
    INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
    SET(requiredlibs ${requiredlibs} ${ICONV_LIBRARY})
ENDIF (Iconv_FOUND)

#####################################################  Xerces-C
INCLUDE(cmake_modules/FindXercesC.cmake)
IF (XERCESC_FOUND)
	INCLUDE_DIRECTORIES(${XERCESC_INCLUDE})
	SET(requiredlibs ${requiredlibs} ${XERCESC_LIBRARY})
ENDIF (XERCESC_FOUND)

##################################################### Json
IF (ZORBA_DEBUGGER)
  SET(requiredlibs ${requiredlibs} json)
ENDIF (ZORBA_DEBUGGER)

#####################################################  Boost
INCLUDE(cmake_modules/FindBoost.cmake)
SET (REQUIRED_BOOST_PACKAGES date_time filesystem program_options)
IF (ZORBA_DEBUGGER)
  SET(REQUIRED_BOOST_PACKAGES ${REQUIRED_BOOST_PACKAGES} boost_thread)
ENDIF (ZORBA_DEBUGGER)

FIND_PACKAGE(Boost REQUIRED COMPONENTS
  date_time
  filesystem
  program_options)

IF (NOT Boost_FOUND)
  MESSAGE(FATAL "Boost not found")
ELSE (NOT Boost_FOUND)
  MESSAGE(STATUS "Found Boost: ${Boost_INCLUDE_DIRS}")
  MESSAGE(STATUS "      Boost: ${Boost_LIBRARY_DIRS}")

  INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
  LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
  IF (NOT WIN32)
      IF (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
          SET(requiredlibs ${requiredlibs} boost_program_options-mt)
          SET(requiredlibs ${requiredlibs} boost_date_time-mt)
          SET(requiredlibs ${requiredlibs} boost_filesystem-mt)
          IF (34 LESS ${Boost_MINOR_VERSION})
            MESSAGE(STATUS "Boost minor version is greater than 34")
          ENDIF (34 LESS ${Boost_MINOR_VERSION})
      ELSE (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
          SET(requiredlibs ${requiredlibs} boost_program_options)
          SET(requiredlibs ${requiredlibs} boost_date_time)
          SET(requiredlibs ${requiredlibs} boost_filesystem)
          IF (34 LESS ${Boost_MINOR_VERSION})
            MESSAGE(STATUS "Boost minor version is greater than 34")
            SET(requiredlibs ${requiredlibs} boost_system)
          ENDIF (34 LESS ${Boost_MINOR_VERSION})
          IF(ZORBA_DEBUGGER)
            SET(requiredlibs ${requiredlibs} boost_thread)<commit_msg>use boost-system if boost version is greater than 1.34<commit_after># 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.
#
# Project name
#
PROJECT(zorba)
ENABLE_TESTING()
INCLUDE(CTest)

# 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 debug
IF(NOT CMAKE_BUILD_TYPE)
  SET(CMAKE_BUILD_TYPE Debug CACHE STRING
      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
      FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)

################################################################################
# Variables
SET(requiredlibs)
SET(DEFINITIONS)

##################################################### Setup Compiler Options
INCLUDE(CMakeCompiler.txt)


################################################################################
# Used libraries

SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)

#####################################################  ICU
INCLUDE(cmake_modules/FindICU.cmake)
IF (NOT ICU_FOUND OR NOT ICU_I18N_FOUND OR NOT ICU_DATA_FOUND)
	MESSAGE(FATAL_ERROR "The ICU library is required in order to build Zorba.")
ELSE (NOT ICU_FOUND OR NOT ICU_I18N_FOUND OR NOT ICU_DATA_FOUND)
    SET(requiredlibs ${requiredlibs} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES} ${ICU_DATA_LIBRARIES})
    INCLUDE_DIRECTORIES(${ICU_INCLUDE_DIRS})
ENDIF (NOT ICU_FOUND OR NOT ICU_I18N_FOUND OR NOT ICU_DATA_FOUND)

#####################################################  LibXml2
FIND_PACKAGE(LibXml2)
IF(LIBXML2_FOUND)
    INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
    SET(requiredlibs ${requiredlibs} ${LIBXML2_LIBRARIES})
    SET(CXXFLAGS ${CXXFLAGS} ${LIBXML2_DEFINITONS})
ELSE(LIBXML2_FOUND)
    MESSAGE(FATAL_ERROR "The libxml2 library is required in order to build Zorba.")
ENDIF(LIBXML2_FOUND)

#####################################################  cURL    
FIND_PACKAGE(CURL)
IF(CURL_FOUND)
  MESSAGE(STATUS "Found cURL library -- " ${CURL_LIBRARIES})
  SET(requiredlibs ${requiredlibs} ${CURL_LIBRARIES})  
  INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
ELSE(CURL_FOUND)
  MESSAGE(STATUS "The cURL library was not found.")
ENDIF(CURL_FOUND)

#####################################################  Iconv
INCLUDE(cmake_modules/FindIconv.cmake)
FIND_PACKAGE(Iconv)
IF (Iconv_FOUND)
    INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
    SET(requiredlibs ${requiredlibs} ${ICONV_LIBRARY})
ENDIF (Iconv_FOUND)

#####################################################  Xerces-C
INCLUDE(cmake_modules/FindXercesC.cmake)
IF (XERCESC_FOUND)
	INCLUDE_DIRECTORIES(${XERCESC_INCLUDE})
	SET(requiredlibs ${requiredlibs} ${XERCESC_LIBRARY})
ENDIF (XERCESC_FOUND)

##################################################### Json
IF (ZORBA_DEBUGGER)
  SET(requiredlibs ${requiredlibs} json)
ENDIF (ZORBA_DEBUGGER)

#####################################################  Boost
INCLUDE(cmake_modules/FindBoost.cmake)
SET (REQUIRED_BOOST_PACKAGES date_time filesystem program_options)
IF (ZORBA_DEBUGGER)
  SET(REQUIRED_BOOST_PACKAGES ${REQUIRED_BOOST_PACKAGES} boost_thread)
ENDIF (ZORBA_DEBUGGER)

FIND_PACKAGE(Boost REQUIRED COMPONENTS
  date_time
  filesystem
  program_options)

IF (NOT Boost_FOUND)
  MESSAGE(FATAL "Boost not found")
ELSE (NOT Boost_FOUND)
  MESSAGE(STATUS "Found Boost: ${Boost_INCLUDE_DIRS}")
  MESSAGE(STATUS "      Boost: ${Boost_LIBRARY_DIRS}")

  INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
  LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
  IF (NOT WIN32)
      IF (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
          SET(requiredlibs ${requiredlibs} boost_program_options-mt)
          SET(requiredlibs ${requiredlibs} boost_date_time-mt)
          SET(requiredlibs ${requiredlibs} boost_filesystem-mt)
          IF (34 LESS ${Boost_MINOR_VERSION})
            MESSAGE(STATUS "Boost minor version is greater than 34")
            SET(requiredlibs ${requiredlibs} boost_system-mt)
          ENDIF (34 LESS ${Boost_MINOR_VERSION})
      ELSE (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
          SET(requiredlibs ${requiredlibs} boost_program_options)
          SET(requiredlibs ${requiredlibs} boost_date_time)
          SET(requiredlibs ${requiredlibs} boost_filesystem)
          IF (34 LESS ${Boost_MINOR_VERSION})
            MESSAGE(STATUS "Boost minor version is greater than 34")
            SET(requiredlibs ${requiredlibs} boost_system)
          ENDIF (34 LESS ${Boost_MINOR_VERSION})
          IF(ZORBA_DEBUGGER)
            SET(requiredlibs ${requiredlibs} boost_thread)
{'fraction_non_alphanumeric': 0.18742564290290106, 'fraction_numerical': 0.008144962020682713, 'mean_word_length': 5.8946372239747635, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6365753', 'n_tokens_mistral': 3823, 'n_tokens_neox': 3401, 'n_words': 816}