<commit_before>#==============================================================================
# Copyright (c) 2011-2013 <NAME> <<EMAIL>>
# Copyright (c) 2013-2014 <NAME> <<EMAIL>>
#==============================================================================
# Welcome to the CMake build system for RDO STUDIO.
# This is the main file where we prepare the general build environment
# and provide build configuration options.
#==============================================================================

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
PROJECT(rdo)

#==============================================================================

SET(PROJECT_NAME         "rdo")
SET(PROJECT_DESCRIPTION  "CMake build system for ${PROJECT_NAME} projects")
SET(PROJECT_VENDOR       "BMSTU")
SET(PROJECT_VENDOR_LONG  "BMSTU")
SET(PROJECT_COPYRIGHT    "Copyright ${PROJECT_VENDOR_LONG}")
SET(PROJECT_VERSION      "{TEMP}")
SET(PROJECT_VERSION_LONG "{TEMP}")
SET(ORG_WEBSITE          "http://rdo.rk9.bmstu.ru")

#==============================================================================

MESSAGE(STATUS "Create RDO")
STRING(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)

ADD_DEFINITIONS(-DRDO_ST)
ADD_DEFINITIONS(-DRDO_LIMIT_RES)
ADD_DEFINITIONS(-DRDO_LICENSE_ACADEMIC)
ADD_DEFINITIONS(-DNOMINMAX)
ADD_DEFINITIONS(-DBOOST_SIGNALS_NO_DEPRECATION_WARNING)

# work with cmake
SET(CMAKE_PREFIX_PATH $ENV{QTDIR}/lib/cmake)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

# call system info script
INCLUDE(FindOS)
INCLUDE(add.boost.test)

IF(MSVC)
    STRING(REGEX REPLACE /W[0-4] /W4 CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
    SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /Ot /Ob2 /MD")
    SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} /MDd /Zi /Od")
    SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
    SET(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")
ELSE()
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
    IF(MINGW)
        ADD_DEFINITIONS(-Wno-unused-local-typedefs)
    ELSE()
        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
    ENDIF()
ENDIF()
SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")

IF(NOT MSVC)
    IF(NOT BUILD_SHARED_LIBS)
        SET(BUILD_SHARED_LIBS ON)
    ENDIF(NOT BUILD_SHARED_LIBS)
#   SET(CDEFS "-m32 -o output32")
ENDIF(NOT MSVC)

SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})

INCLUDE(CTest)
ENABLE_TESTING()

IF(MSVC)
    SET(Boost_USE_STATIC_LIBS    ON)
    SET(Boost_USE_MULTITHREADED  ON)
ELSE()
    IF(MINGW)
        SET(Boost_USE_STATIC_LIBS    OFF)
        SET(Boost_USE_MULTITHREADED  ON)
    ENDIF()
ENDIF()

# enable folders for msvc
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)

SET(APPS_FOLDERS       ".apps")
SET(TESTS_FOLDERS      ".tests")
SET(LIBRARY_FOLDERS    ".modules")
SET(THIRDPARTY_FOLDERS ".thirdparty")

IF(WIN32)
    IF(NOT BOOST_ROOT)
        SET(BOOST_ROOT $ENV{BOOST_ROOT})
    ENDIF()
ENDIF(WIN32)

# set base directory
SET(RDO_BASE_DIRECTORY ${PROJECT_SOURCE_DIR})

IF(MSVC OR MINGW)
    SET(PATH_STRING $ENV{PATH})
    STRING(FIND "${PATH_STRING}" "thirdparty/bison_flex/bin" OUT)
    IF(${OUT} GREATER -1)
    ELSE()
        SET(ENV{PATH} "$ENV{PATH};${RDO_BASE_DIRECTORY}/thirdparty/bison_flex/bin")
    ENDIF()
ENDIF()

#==============================================================================

SET(SCRIPTS_DIRECTORY ${RDO_BASE_DIRECTORY}/scripts)

FILE(GLOB_RECURSE SCRIPT_FILES ${SCRIPTS_DIRECTORY}/*)

FILE(GLOB DOC_FILES ${RDO_BASE_DIRECTORY}/doc/*.txt)
LIST(APPEND DOC_FILES ${RDO_BASE_DIRECTORY}/doc/rdodoc-src-html.doxyfile)

SET(TEXT_FILES
    ${CMAKE_CURRENT_SOURCE_DIR}/README.md
    ${SCRIPT_FILES}
    ${DOC_FILES}
    )

#==============================================================================
#----------------------------- get git version --------------------------------
#==============================================================================

FIND_PACKAGE(Git)

IF(NOT GIT_FOUND)
    MESSAGE(FATAL_ERROR "GIT NOT FOUND")
ENDIF()

SET(GIT_RES_LONG FALSE)
SET(GIT_RES_SHORT FALSE)

SET(GIT_FILE_VERSION_LONG  "${CMAKE_CURRENT_BINARY_DIR}/git.version.long")
SET(GIT_FILE_VERSION_SHORT "${CMAKE_CURRENT_BINARY_DIR}/git.version.short")

EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe --tags WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE ${GIT_RES_LONG}  OUTPUT_FILE ${GIT_FILE_VERSION_LONG})
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe --abbrev=0 --tags WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE ${GIT_RES_SHORT} OUTPUT_FILE ${GIT_FILE_VERSION_SHORT})

FILE(READ ${GIT_FILE_VERSION_LONG} READ_DATA_LONG)
STRING(REPLACE "\n" "" GIT_VERSION_LONG ${READ_DATA_LONG})

FILE(READ ${GIT_FILE_VERSION_SHORT} READ_DATA_SHORT)
STRING(REPLACE "\n" "" GIT_VERSION_SHORT ${READ_DATA_SHORT})

MESSAGE(STATUS "Git version : ${GIT_VERSION_LONG}")

STRING(LENGTH "${GIT_VERSION_LONG}" TEMP_LENGTH)
STRING(SUBSTRING "${GIT_VERSION_LONG}" 1 -1 GIT_VERSION_LONG_NUM)

STRING(LENGTH "${GIT_VERSION_SHORT}" TEMP_LENGTH)
STRING(SUBSTRING "${GIT_VERSION_SHORT}" 1 -1 GIT_VERSION_SHORT_NUM)

SET(GIT_VERSION ${GIT_VERSION_SHORT})

#==============================================================================

SET(PROJECT_VERSION      ${GIT_VERSION_SHORT})
SET(PROJECT_VERSION_LONG ${GIT_VERSION_LONG} )

#==============================================================================

IF(WIN32)
    IF(NOT MINGW)
        INCLUDE(win32.install)
    ENDIF()
ENDIF()

#==============================================================================<commit_msg>Изменён вывод<commit_after>#==============================================================================
# Copyright (c) 2011-2013 <NAME> <<EMAIL>>
# Copyright (c) 2013-2014 <NAME> <<EMAIL>>
#==============================================================================
# Welcome to the CMake build system for RDO STUDIO.
# This is the main file where we prepare the general build environment
# and provide build configuration options.
#==============================================================================

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
PROJECT(rdo)

#==============================================================================

SET(PROJECT_NAME         "rdo")
SET(PROJECT_DESCRIPTION  "CMake build system for ${PROJECT_NAME} projects")
SET(PROJECT_VENDOR       "BMSTU")
SET(PROJECT_VENDOR_LONG  "BMSTU")
SET(PROJECT_COPYRIGHT    "Copyright ${PROJECT_VENDOR_LONG}")
SET(PROJECT_VERSION      "{TEMP}")
SET(PROJECT_VERSION_LONG "{TEMP}")
SET(ORG_WEBSITE          "http://rdo.rk9.bmstu.ru")

#==============================================================================

MESSAGE(STATUS "Create RDO")
STRING(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)

ADD_DEFINITIONS(-DRDO_ST)
ADD_DEFINITIONS(-DRDO_LIMIT_RES)
ADD_DEFINITIONS(-DRDO_LICENSE_ACADEMIC)
ADD_DEFINITIONS(-DNOMINMAX)
ADD_DEFINITIONS(-DBOOST_SIGNALS_NO_DEPRECATION_WARNING)

# work with cmake
SET(CMAKE_PREFIX_PATH $ENV{QTDIR}/lib/cmake)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

# call system info script
INCLUDE(FindOS)
INCLUDE(add.boost.test)

IF(MSVC)
    STRING(REGEX REPLACE /W[0-4] /W4 CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
    SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /Ot /Ob2 /MD")
    SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} /MDd /Zi /Od")
    SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
    SET(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")
ELSE()
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
    IF(MINGW)
        ADD_DEFINITIONS(-Wno-unused-local-typedefs)
    ELSE()
        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
    ENDIF()
ENDIF()
SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")

IF(NOT MSVC)
    IF(NOT BUILD_SHARED_LIBS)
        SET(BUILD_SHARED_LIBS ON)
    ENDIF(NOT BUILD_SHARED_LIBS)
#   SET(CDEFS "-m32 -o output32")
ENDIF(NOT MSVC)

SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})

INCLUDE(CTest)
ENABLE_TESTING()

IF(MSVC)
    SET(Boost_USE_STATIC_LIBS    ON)
    SET(Boost_USE_MULTITHREADED  ON)
ELSE()
    IF(MINGW)
        SET(Boost_USE_STATIC_LIBS    OFF)
        SET(Boost_USE_MULTITHREADED  ON)
    ENDIF()
ENDIF()

# enable folders for msvc
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)

SET(APPS_FOLDERS       ".apps")
SET(TESTS_FOLDERS      ".tests")
SET(LIBRARY_FOLDERS    ".modules")
SET(THIRDPARTY_FOLDERS ".thirdparty")

IF(WIN32)
    IF(NOT BOOST_ROOT)
        SET(BOOST_ROOT $ENV{BOOST_ROOT})
    ENDIF()
ENDIF(WIN32)

# set base directory
SET(RDO_BASE_DIRECTORY ${PROJECT_SOURCE_DIR})

IF(MSVC OR MINGW)
    SET(PATH_STRING $ENV{PATH})
    STRING(FIND "${PATH_STRING}" "thirdparty/bison_flex/bin" OUT)
    IF(${OUT} GREATER -1)
    ELSE()
        SET(ENV{PATH} "$ENV{PATH};${RDO_BASE_DIRECTORY}/thirdparty/bison_flex/bin")
    ENDIF()
ENDIF()

#==============================================================================

SET(SCRIPTS_DIRECTORY ${RDO_BASE_DIRECTORY}/scripts)

FILE(GLOB_RECURSE SCRIPT_FILES ${SCRIPTS_DIRECTORY}/*)

FILE(GLOB DOC_FILES ${RDO_BASE_DIRECTORY}/doc/*.txt)
LIST(APPEND DOC_FILES ${RDO_BASE_DIRECTORY}/doc/rdodoc-src-html.doxyfile)

SET(TEXT_FILES
    ${CMAKE_CURRENT_SOURCE_DIR}/README.md
    ${SCRIPT_FILES}
    ${DOC_FILES}
    )

#==============================================================================
#----------------------------- get git version --------------------------------
#==============================================================================

FIND_PACKAGE(Git)

IF(NOT GIT_FOUND)
    MESSAGE(FATAL_ERROR "GIT NOT FOUND")
ENDIF()

SET(GIT_RES_LONG FALSE)
SET(GIT_RES_SHORT FALSE)

SET(GIT_FILE_VERSION_LONG  "${CMAKE_CURRENT_BINARY_DIR}/git.version.long")
SET(GIT_FILE_VERSION_SHORT "${CMAKE_CURRENT_BINARY_DIR}/git.version.short")

EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe --tags WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE ${GIT_RES_LONG}  OUTPUT_FILE ${GIT_FILE_VERSION_LONG})
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe --abbrev=0 --tags WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE ${GIT_RES_SHORT} OUTPUT_FILE ${GIT_FILE_VERSION_SHORT})

FILE(READ ${GIT_FILE_VERSION_LONG} READ_DATA_LONG)
STRING(REPLACE "\n" "" GIT_VERSION_LONG ${READ_DATA_LONG})

FILE(READ ${GIT_FILE_VERSION_SHORT} READ_DATA_SHORT)
STRING(REPLACE "\n" "" GIT_VERSION_SHORT ${READ_DATA_SHORT})

MESSAGE(STATUS "rdo version : ${GIT_VERSION_LONG}")

STRING(LENGTH "${GIT_VERSION_LONG}" TEMP_LENGTH)
STRING(SUBSTRING "${GIT_VERSION_LONG}" 1 -1 GIT_VERSION_LONG_NUM)

STRING(LENGTH "${GIT_VERSION_SHORT}" TEMP_LENGTH)
STRING(SUBSTRING "${GIT_VERSION_SHORT}" 1 -1 GIT_VERSION_SHORT_NUM)

SET(GIT_VERSION ${GIT_VERSION_SHORT})

#==============================================================================

SET(PROJECT_VERSION      ${GIT_VERSION_SHORT})
SET(PROJECT_VERSION_LONG ${GIT_VERSION_LONG} )

#==============================================================================

IF(WIN32)
    IF(NOT MINGW)
        INCLUDE(win32.install)
    ENDIF()
ENDIF()

#==============================================================================
{'fraction_non_alphanumeric': 0.2642932304454577, 'fraction_numerical': 0.007541213609259909, 'mean_word_length': 6.454248366013072, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '4350940', 'n_tokens_mistral': 4252, 'n_tokens_neox': 3901, 'n_words': 615}