<commit_before>PROJECT(openCherry)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMake/")

INCLUDE(MacroParseArguments)
INCLUDE(MacroConvertSchema)
INCLUDE(MacroOrganizeSources)
INCLUDE(cherryPluginHelpers)
INCLUDE(MacroCollectPlugins)
INCLUDE(MacroParseManifest)
INCLUDE(MacroCreatePlugin)
INCLUDE(MacroInstallPlugin)


IF(MSVC)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4275 /wd4251")
ENDIF()

IF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
  SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
ENDIF ()

FIND_PACKAGE(mbilog REQUIRED)
INCLUDE_DIRECTORIES(${mbilog_INCLUDE_DIRS})

OPTION(OPENCHERRY_USE_QT "Use the Qt GUI toolkit" OFF)

IF(NOT DESIRED_QT_VERSION)
  SET(DESIRED_QT_VERSION 4 CACHE STRING "Desired Qt version" FORCE)
  MARK_AS_ADVANCED(DESIRED_QT_VERSION)
ENDIF()

IF(OPENCHERRY_USE_QT AND NOT DESIRED_QT_VERSION EQUAL 4)
  MESSAGE("Attention: Qt4 is required to build the openCherry Qt plug-ins.")
ENDIF()

IF(OPENCHERRY_USE_QT AND DESIRED_QT_VERSION EQUAL 4)
  SET(QT_MT_REQUIRED 1)
  SET(BUILD_QT_PLUGINS 1)
  FIND_PACKAGE(Qt REQUIRED)
  
  INCLUDE(${QT_USE_FILE})
ENDIF()

OPTION(OPENCHERRY_BUILD_ALL_PLUGINS "Build all openCherry plugins (overriding selection)" OFF)
MARK_AS_ADVANCED(BUILD_ALL_OPENCHERRY_PLUGINS)

IF(OPENCHERRY_BUILD_ALL_PLUGINS)
  SET(OPENCHERRY_BUILD_ALL_PLUGINS_OPTION "FORCE_BUILD_ALL")
ENDIF()

OPTION(OPENCHERRY_STATIC "Build all plugins as static libraries" OFF)
MARK_AS_ADVANCED(OPENCHERRY_STATIC)

OPTION(OPENCHERRY_DEBUG_SMARTPOINTER "Enable code for debugging smart pointers" OFF)
MARK_AS_ADVANCED(OPENCHERRY_DEBUG_SMARTPOINTER)

FIND_PACKAGE(Poco REQUIRED)
FIND_PACKAGE(Ant)
FIND_PACKAGE(Eclipse)

SET(OPENCHERRY_SOURCE_DIR ${openCherry_SOURCE_DIR})
SET(OPENCHERRY_BINARY_DIR ${openCherry_BINARY_DIR})

SET(OPENCHERRY_PLUGINS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Bundles)
SET(OPENCHERRY_PLUGINS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Bundles)

SET(OSGI_APP solstice)

# Force should be removed after everybody has configured their old binary tree
SET(OPENCHERRY_PLUGINS_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/openCherry CACHE PATH "Directory where to build the openCherry Bundles" FORCE)
MARK_AS_ADVANCED(OPENCHERRY_PLUGINS_OUTPUT_DIR)

SET(OPENCHERRY_TEST_PLUGINS_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/openCherryTests CACHE PATH "Directory where to build the openCherry test bundles")
MARK_AS_ADVANCED(OPENCHERRY_TEST_PLUGINS_OUTPUT_DIR)

# Clear the cache variables
SET(OPENCHERRY_PLUGIN_SOURCE_DIRS "" CACHE INTERNAL "List of base plugin source directories" FORCE)
SET(OPENCHERRY_PLUGIN_BINARY_DIRS "" CACHE INTERNAL "List of base plugin binary directories" FORCE)

IF (Eclipse_DIR)
  SET(OPENCHERRY_DOC_TOOLS_DIR "${Eclipse_DIR}" CACHE PATH "Directory containing additional tools needed for generating the documentation" FORCE)
ELSE ()
  SET(OPENCHERRY_DOC_TOOLS_DIR "" CACHE PATH "Directory containing additional tools needed for generating the documentation")
ENDIF ()

SET(OPENCHERRY_DEBUG_POSTFIX d)

CONFIGURE_FILE(openCherryConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/openCherryConfig.cmake @ONLY)<commit_msg>COMP: if Eclipse is found via CMake on Linux, the variable OPENCHERRY_DOC_TOOLS_DIR is always overwritten and doxygen generation fails, so removing FORCE from SET command.<commit_after>PROJECT(openCherry)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMake/")

INCLUDE(MacroParseArguments)
INCLUDE(MacroConvertSchema)
INCLUDE(MacroOrganizeSources)
INCLUDE(cherryPluginHelpers)
INCLUDE(MacroCollectPlugins)
INCLUDE(MacroParseManifest)
INCLUDE(MacroCreatePlugin)
INCLUDE(MacroInstallPlugin)


IF(MSVC)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4275 /wd4251")
ENDIF()

IF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
  SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
ENDIF ()

FIND_PACKAGE(mbilog REQUIRED)
INCLUDE_DIRECTORIES(${mbilog_INCLUDE_DIRS})

OPTION(OPENCHERRY_USE_QT "Use the Qt GUI toolkit" OFF)

IF(NOT DESIRED_QT_VERSION)
  SET(DESIRED_QT_VERSION 4 CACHE STRING "Desired Qt version" FORCE)
  MARK_AS_ADVANCED(DESIRED_QT_VERSION)
ENDIF()

IF(OPENCHERRY_USE_QT AND NOT DESIRED_QT_VERSION EQUAL 4)
  MESSAGE("Attention: Qt4 is required to build the openCherry Qt plug-ins.")
ENDIF()

IF(OPENCHERRY_USE_QT AND DESIRED_QT_VERSION EQUAL 4)
  SET(QT_MT_REQUIRED 1)
  SET(BUILD_QT_PLUGINS 1)
  FIND_PACKAGE(Qt REQUIRED)
  
  INCLUDE(${QT_USE_FILE})
ENDIF()

OPTION(OPENCHERRY_BUILD_ALL_PLUGINS "Build all openCherry plugins (overriding selection)" OFF)
MARK_AS_ADVANCED(BUILD_ALL_OPENCHERRY_PLUGINS)

IF(OPENCHERRY_BUILD_ALL_PLUGINS)
  SET(OPENCHERRY_BUILD_ALL_PLUGINS_OPTION "FORCE_BUILD_ALL")
ENDIF()

OPTION(OPENCHERRY_STATIC "Build all plugins as static libraries" OFF)
MARK_AS_ADVANCED(OPENCHERRY_STATIC)

OPTION(OPENCHERRY_DEBUG_SMARTPOINTER "Enable code for debugging smart pointers" OFF)
MARK_AS_ADVANCED(OPENCHERRY_DEBUG_SMARTPOINTER)

FIND_PACKAGE(Poco REQUIRED)
FIND_PACKAGE(Ant)
FIND_PACKAGE(Eclipse)

SET(OPENCHERRY_SOURCE_DIR ${openCherry_SOURCE_DIR})
SET(OPENCHERRY_BINARY_DIR ${openCherry_BINARY_DIR})

SET(OPENCHERRY_PLUGINS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Bundles)
SET(OPENCHERRY_PLUGINS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Bundles)

SET(OSGI_APP solstice)

# Force should be removed after everybody has configured their old binary tree
SET(OPENCHERRY_PLUGINS_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/openCherry CACHE PATH "Directory where to build the openCherry Bundles" FORCE)
MARK_AS_ADVANCED(OPENCHERRY_PLUGINS_OUTPUT_DIR)

SET(OPENCHERRY_TEST_PLUGINS_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/openCherryTests CACHE PATH "Directory where to build the openCherry test bundles")
MARK_AS_ADVANCED(OPENCHERRY_TEST_PLUGINS_OUTPUT_DIR)

# Clear the cache variables
SET(OPENCHERRY_PLUGIN_SOURCE_DIRS "" CACHE INTERNAL "List of base plugin source directories" FORCE)
SET(OPENCHERRY_PLUGIN_BINARY_DIRS "" CACHE INTERNAL "List of base plugin binary directories" FORCE)

IF (Eclipse_DIR)
  SET(OPENCHERRY_DOC_TOOLS_DIR "${Eclipse_DIR}" CACHE PATH "Directory containing additional tools needed for generating the documentation")
ELSE ()
  SET(OPENCHERRY_DOC_TOOLS_DIR "" CACHE PATH "Directory containing additional tools needed for generating the documentation")
ENDIF ()

SET(OPENCHERRY_DEBUG_POSTFIX d)

CONFIGURE_FILE(openCherryConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/openCherryConfig.cmake @ONLY)
{'fraction_non_alphanumeric': 0.07224451991355356, 'fraction_numerical': 0.006174745291756715, 'mean_word_length': 9.466882067851373, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2195626', 'n_tokens_mistral': 2595, 'n_tokens_neox': 2353, 'n_words': 466}