<commit_before>cmake_minimum_required (VERSION 2.8)

project (batyr)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

# http://stackoverflow.com/questions/7724569/debug-vs-release-in-cmake
# Initialize CXXFLAGS.
set(CMAKE_CXX_FLAGS                "-Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wformat-security -Wformat=2")
set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g -D_DEBUG=1")
set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")

# Compiler-specific C++11 activation.
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
    execute_process(
        COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
    if ((GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7))
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
    elseif (GCC_VERSION VERSION_EQUAL 4.6)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
    else ()
        message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.6 or greater.")
    endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else ()
    message(FATAL_ERROR "Your C++ compiler does not support C++11.")
endif ()

find_package( Threads REQUIRED)
#find_package( ZeroMQ REQUIRED)
find_package( GDAL REQUIRED)
find_package( Postgres REQUIRED)
find_package( Poco REQUIRED Foundation Util Net)


#
# Manual project configuration
#

# version information
set(VERSION_MAJOR 0)
set(VERSION_MINOR 2)
set(VERSION_PATCH 3)

# http://brianmilco.blogspot.de/2012/11/cmake-automatically-use-git-tags-as.html
include(GetGitRevisionDescription)
get_git_head_revision(refspec VERSION_GIT_SHA1)
get_git_is_dirty(VERSION_GIT_IS_DIRTY)
STRING(SUBSTRING "${VERSION_GIT_SHA1}" 0 10 VERSION_GIT_SHA1_SHORT)
if ("${VERSION_GIT_IS_DIRTY}" STREQUAL "")
    set(VERSION_GIT_FULL "${VERSION_GIT_SHA1_SHORT}")
else()
    set(VERSION_GIT_FULL "${VERSION_GIT_SHA1_SHORT}-${VERSION_GIT_IS_DIRTY}")
endif()


# compile the http web gui in the server when this is enabled
option(ENABLE_HTTP_WEB_GUI "Enable the HTTP Web user interface" ON)
if (ENABLE_HTTP_WEB_GUI)
    message(STATUS "Building with the Web GUI")
else ()
    message(STATUS "Building without the Web GUI")
endif ()


add_subdirectory(src)

# install additional files
install(FILES   README.md 
                MANUAL.md 
                DEVELOPMENT.md 
                batyrd.cfg.sample
    DESTINATION share/${PROJECT_NAME}
) <commit_msg>set version to 0.2.5<commit_after>cmake_minimum_required (VERSION 2.8)

project (batyr)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

# http://stackoverflow.com/questions/7724569/debug-vs-release-in-cmake
# Initialize CXXFLAGS.
set(CMAKE_CXX_FLAGS                "-Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wformat-security -Wformat=2")
set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g -D_DEBUG=1")
set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")

# Compiler-specific C++11 activation.
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
    execute_process(
        COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
    if ((GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7))
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
    elseif (GCC_VERSION VERSION_EQUAL 4.6)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
    else ()
        message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.6 or greater.")
    endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else ()
    message(FATAL_ERROR "Your C++ compiler does not support C++11.")
endif ()

find_package( Threads REQUIRED)
#find_package( ZeroMQ REQUIRED)
find_package( GDAL REQUIRED)
find_package( Postgres REQUIRED)
find_package( Poco REQUIRED Foundation Util Net)


#
# Manual project configuration
#

# version information
set(VERSION_MAJOR 0)
set(VERSION_MINOR 2)
set(VERSION_PATCH 5)

# http://brianmilco.blogspot.de/2012/11/cmake-automatically-use-git-tags-as.html
include(GetGitRevisionDescription)
get_git_head_revision(refspec VERSION_GIT_SHA1)
get_git_is_dirty(VERSION_GIT_IS_DIRTY)
STRING(SUBSTRING "${VERSION_GIT_SHA1}" 0 10 VERSION_GIT_SHA1_SHORT)
if ("${VERSION_GIT_IS_DIRTY}" STREQUAL "")
    set(VERSION_GIT_FULL "${VERSION_GIT_SHA1_SHORT}")
else()
    set(VERSION_GIT_FULL "${VERSION_GIT_SHA1_SHORT}-${VERSION_GIT_IS_DIRTY}")
endif()


# compile the http web gui in the server when this is enabled
option(ENABLE_HTTP_WEB_GUI "Enable the HTTP Web user interface" ON)
if (ENABLE_HTTP_WEB_GUI)
    message(STATUS "Building with the Web GUI")
else ()
    message(STATUS "Building without the Web GUI")
endif ()


add_subdirectory(src)

# install additional files
install(FILES   README.md
                MANUAL.md
                DEVELOPMENT.md
                batyrd.cfg.sample
    DESTINATION share/${PROJECT_NAME}
)
{'fraction_non_alphanumeric': 0.11639000190803282, 'fraction_numerical': 0.019652738027094066, 'mean_word_length': 4.697826086956522, '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': '5344599', 'n_tokens_mistral': 2106, 'n_tokens_neox': 1913, 'n_words': 377}