<commit_before>
cmake_minimum_required (VERSION 2.8.0)

project (cclive)

set (CMAKE_VERBOSE_MAKEFILE false)

add_definitions (-Wall)
#add_definitions (-Werror)

# Version.

set (VERSION "0.7.0rc2")
set (VERSION_LONG "${VERSION}")
set (BRANCH "0.7.0")

if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
    find_program (GIT_PROG "git")
    if (GIT_PROG)
        execute_process (
            COMMAND ${GIT_PROG} "describe" "${BRANCH}"
            OUTPUT_VARIABLE DESCR
            OUTPUT_STRIP_TRAILING_WHITESPACE)
        if (DESCR)
            set (VERSION_LONG "${DESCR}")
        endif ()
    endif ()
endif ()

find_program (DATE_PROG "date")
if (DATE_PROG)
    execute_process (
        COMMAND ${DATE_PROG} "+%Y-%m-%d"
        OUTPUT_VARIABLE DATE
        OUTPUT_STRIP_TRAILING_WHITESPACE)
    if (DATE)
        set (VERSION_LONG "${VERSION_LONG} built on ${DATE}")
    endif ()
endif ()

set (HOST_SETUP "${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}")
set (VERSION_LONG "${VERSION_LONG} for ${HOST_SETUP}")

# gzip.

find_program (GZIP_PROG "gzip")

# pod2man.

find_program (POD2MAN_PROG "pod2man")
if (POD2MAN_PROG)
    add_custom_target (pod2man
        "${POD2MAN_PROG}" -c "cclive manual" -n cclive -s 1 -r ${VERSION}
        ${CMAKE_CURRENT_SOURCE_DIR}/man1/cclive.1.pod
        ${CMAKE_CURRENT_BINARY_DIR}/man1/cclive.1
    )
endif ()

# Set default build type.

if (NOT CMAKE_BUILD_TYPE)
    set (CMAKE_BUILD_TYPE "debug")
endif ()

# Set default for WITHOUT_DOC.

if (NOT WITHOUT_DOC)
    set (WITHOUT_DOC false)
endif ()

# Prerequisites.

include (FindPkgConfig)

pkg_check_modules (quvi     libquvi>=0.2.0 REQUIRED)
include_directories (AFTER ${quvi_INCLUDE_DIRS})
link_directories (${quvi_LIBRARY_DIRS})

pkg_check_modules (curl     libcurl>=7.20 REQUIRED)
include_directories (AFTER ${curl_INCLUDE_DIRS})
link_directories (${curl_LIBRARY_DIRS})

pkg_check_modules (pcre libpcrecpp>=8.10 REQUIRED)
include_directories (AFTER ${pcre_INCLUDE_DIRS})
link_directories (${pcre_LIBRARY_DIRS})

pkg_check_modules (pcrecpp  libpcrecpp>=8.10 REQUIRED)
include_directories (AFTER ${pcrecpp_INCLUDE_DIRS})
link_directories (${pcrecpp_LIBRARY_DIRS})

# Prerequisites: Boost

set (boost_LIBS
    program_options
    iostreams
    filesystem
    system
# foreach   -- this is a header-only library
# format    -- ditto
# date_time -- ...
# random    -- ...
)

set (Boost_USE_STATIC_LIBS   OFF)
set (Boost_USE_MULTITHREADED OFF)

find_package (Boost 1.43.0 COMPONENTS ${boost_LIBS} REQUIRED)

include_directories (AFTER ${Boost_INCLUDE_DIR})
link_directories (${Boost_LIBRARY_DIRS})

# Check for headers.

include (CheckIncludeFile)
check_include_file (unistd.h    HAVE_UNISTD_H)
check_include_file (sys/types.h HAVE_SYS_TYPES_H)
check_include_file (sys/ioctl.h HAVE_SYS_IOCTL_H)
check_include_file (sys/stat.h  HAVE_SYS_STAT_H)
check_include_file (signal.h    HAVE_SIGNAL_H)

# Check for functions

include (CheckFunctionExists)
check_function_exists (strerror_r   HAVE_STRERROR_R)
check_function_exists (strerror     HAVE_STRERROR)
check_function_exists (fork         HAVE_FORK)
check_function_exists (getcwd       HAVE_GETCWD)

# Subdirs.

subdirs (lib cclive man1)

# Status.

message (STATUS)
message (STATUS "cclive version     : ${VERSION}")
message (STATUS "host setup         : ${HOST_SETUP}")
message (STATUS "install prefix     : ${CMAKE_INSTALL_PREFIX}")
message (STATUS "build type         : ${CMAKE_BUILD_TYPE}")
message (STATUS "  (debug, release, relwithdebinfo, minsizerel)")
message (STATUS "compiler           : ${CMAKE_CXX_COMPILER}")
message (STATUS "linker             : ${CMAKE_LINKER}")
message (STATUS "make               : ${CMAKE_MAKE_PROGRAM}")
message (STATUS "verbose make       : ${CMAKE_VERBOSE_MAKEFILE}")
message (STATUS "without doc        : ${WITHOUT_DOC}")
message (STATUS)

# Force these variables to be written to cache.

set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH
    "Install destination for ${PROJECT_NAME}" FORCE)

set (CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
    "Type of build: none, debug, release, relwithdebinfo minsizerel" FORCE)

set (CMAKE_VERBOSE_MAKEFILE "${CMAKE_VERBOSE_MAKEFILE}" CACHE BOOL
    "Build with verbose makefiles: true, false" FORCE)

set (WITHOUT_DOC "${WITHOUT_DOC}" CACHE BOOL
    "Install without documentation: true, false" FORCE)

# config.h

configure_file (
    "${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/config.h"
)

# CPack.

include (InstallRequiredSystemLibraries)

set (CPACK_SOURCE_PACKAGE_FILE_NAME
    "cclive-${VERSION}"
    CACHE INTERNAL
    "tarball basename"
)

set (CPACK_PACKAGE_FILE_NAME ${CPACK_SOURCE_PACKAGE_FILE_NAME})
set (CPACK_GENERATOR "TGZ")
set (CPACK_SOURCE_GENERATOR "TGZ")
set (CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING)
set (CPACK_RESOURCE_FILE_README  ${CMAKE_CURRENT_SOURCE_DIR}/README)

set (CPACK_SOURCE_IGNORE_FILES
    "/.git"
    "/.cmake/"
    "/CMakeFiles/"
    "/CMakeCache/"
    "/Makefile/"
    "/tmp/"
    "/OLD/"
    "/old/"
    "TODO"
)

# Notice the inclusion here, after setting the cpack variables.
include (CPack)

# Uninstall.

configure_file (
    "${CMAKE_CURRENT_SOURCE_DIR}/uninstall.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
    IMMEDIATE @ONLY
)

add_custom_target (
    uninstall
    "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
)


<commit_msg>CMakeLists.txt: status: put in groups<commit_after>
cmake_minimum_required (VERSION 2.8.0)

project (cclive)

set (CMAKE_VERBOSE_MAKEFILE false)

add_definitions (-Wall)
#add_definitions (-Werror)

# Version.

set (VERSION "0.7.0rc2")
set (VERSION_LONG "${VERSION}")
set (BRANCH "0.7.0")

if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
    find_program (GIT_PROG "git")
    if (GIT_PROG)
        execute_process (
            COMMAND ${GIT_PROG} "describe" "${BRANCH}"
            OUTPUT_VARIABLE DESCR
            OUTPUT_STRIP_TRAILING_WHITESPACE)
        if (DESCR)
            set (VERSION_LONG "${DESCR}")
        endif ()
    endif ()
endif ()

find_program (DATE_PROG "date")
if (DATE_PROG)
    execute_process (
        COMMAND ${DATE_PROG} "+%Y-%m-%d"
        OUTPUT_VARIABLE DATE
        OUTPUT_STRIP_TRAILING_WHITESPACE)
    if (DATE)
        set (VERSION_LONG "${VERSION_LONG} built on ${DATE}")
    endif ()
endif ()

set (HOST_SETUP "${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}")
set (VERSION_LONG "${VERSION_LONG} for ${HOST_SETUP}")

# gzip.

find_program (GZIP_PROG "gzip")

# pod2man.

find_program (POD2MAN_PROG "pod2man")
if (POD2MAN_PROG)
    add_custom_target (pod2man
        "${POD2MAN_PROG}" -c "cclive manual" -n cclive -s 1 -r ${VERSION}
        ${CMAKE_CURRENT_SOURCE_DIR}/man1/cclive.1.pod
        ${CMAKE_CURRENT_BINARY_DIR}/man1/cclive.1
    )
endif ()

# Set default build type.

if (NOT CMAKE_BUILD_TYPE)
    set (CMAKE_BUILD_TYPE "debug")
endif ()

# Set default for WITHOUT_DOC.

if (NOT WITHOUT_DOC)
    set (WITHOUT_DOC false)
endif ()

# Prerequisites.

include (FindPkgConfig)

pkg_check_modules (quvi     libquvi>=0.2.0 REQUIRED)
include_directories (AFTER ${quvi_INCLUDE_DIRS})
link_directories (${quvi_LIBRARY_DIRS})

pkg_check_modules (curl     libcurl>=7.20 REQUIRED)
include_directories (AFTER ${curl_INCLUDE_DIRS})
link_directories (${curl_LIBRARY_DIRS})

pkg_check_modules (pcre libpcrecpp>=8.10 REQUIRED)
include_directories (AFTER ${pcre_INCLUDE_DIRS})
link_directories (${pcre_LIBRARY_DIRS})

pkg_check_modules (pcrecpp  libpcrecpp>=8.10 REQUIRED)
include_directories (AFTER ${pcrecpp_INCLUDE_DIRS})
link_directories (${pcrecpp_LIBRARY_DIRS})

# Prerequisites: Boost

set (boost_LIBS
    program_options
    iostreams
    filesystem
    system
# foreach   -- this is a header-only library
# format    -- ditto
# date_time -- ...
# random    -- ...
)

set (Boost_USE_STATIC_LIBS   OFF)
set (Boost_USE_MULTITHREADED OFF)

find_package (Boost 1.43.0 COMPONENTS ${boost_LIBS} REQUIRED)

include_directories (AFTER ${Boost_INCLUDE_DIR})
link_directories (${Boost_LIBRARY_DIRS})

set (boost_VERSION
    "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")

# Check for headers.

include (CheckIncludeFile)
check_include_file (unistd.h    HAVE_UNISTD_H)
check_include_file (sys/types.h HAVE_SYS_TYPES_H)
check_include_file (sys/ioctl.h HAVE_SYS_IOCTL_H)
check_include_file (sys/stat.h  HAVE_SYS_STAT_H)
check_include_file (signal.h    HAVE_SIGNAL_H)

# Check for functions

include (CheckFunctionExists)
check_function_exists (strerror_r   HAVE_STRERROR_R)
check_function_exists (strerror     HAVE_STRERROR)
check_function_exists (fork         HAVE_FORK)
check_function_exists (getcwd       HAVE_GETCWD)

# Subdirs.

subdirs (lib cclive man1)

# Status.

message (STATUS)
message (STATUS "Configuration for")
message (STATUS "   cclive ${VERSION_LONG}")
message (STATUS)
message (STATUS "Options:")
message (STATUS "   Install prefix: ${CMAKE_INSTALL_PREFIX}")
message (STATUS "   Host setup    : ${HOST_SETUP}")
message (STATUS "   Build type    : ${CMAKE_BUILD_TYPE}")
message (STATUS "       (debug, release, relwithdebinfo, minsizerel)")
message (STATUS "   Verbose make  : ${CMAKE_VERBOSE_MAKEFILE}")
message (STATUS "   Without doc   : ${WITHOUT_DOC}")
message (STATUS)
message (STATUS "Found:")
message (STATUS "   Compiler: ${CMAKE_CXX_COMPILER}")
message (STATUS "   Linker  : ${CMAKE_LINKER}")
message (STATUS "   Make    : ${CMAKE_MAKE_PROGRAM}")
message (STATUS "   quvi    : ${quvi_VERSION}")
message (STATUS "   curl    : ${curl_VERSION}")
message (STATUS "   pcre    : ${pcre_VERSION}")
message (STATUS "   boost   : ${boost_VERSION}")
message (STATUS)

# Force these variables to be written to cache.

set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH
    "Install destination for ${PROJECT_NAME}" FORCE)

set (CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
    "Type of build: none, debug, release, relwithdebinfo minsizerel" FORCE)

set (CMAKE_VERBOSE_MAKEFILE "${CMAKE_VERBOSE_MAKEFILE}" CACHE BOOL
    "Build with verbose makefiles: true, false" FORCE)

set (WITHOUT_DOC "${WITHOUT_DOC}" CACHE BOOL
    "Install without documentation: true, false" FORCE)

# config.h

configure_file (
    "${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/config.h"
)

# CPack.

include (InstallRequiredSystemLibraries)

set (CPACK_SOURCE_PACKAGE_FILE_NAME
    "cclive-${VERSION}"
    CACHE INTERNAL
    "tarball basename"
)

set (CPACK_PACKAGE_FILE_NAME ${CPACK_SOURCE_PACKAGE_FILE_NAME})
set (CPACK_GENERATOR "TGZ")
set (CPACK_SOURCE_GENERATOR "TGZ")
set (CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING)
set (CPACK_RESOURCE_FILE_README  ${CMAKE_CURRENT_SOURCE_DIR}/README)

set (CPACK_SOURCE_IGNORE_FILES
    "/.git"
    "/.cmake/"
    "/CMakeFiles/"
    "/CMakeCache/"
    "/Makefile/"
    "/tmp/"
    "/OLD/"
    "/old/"
    "TODO"
)

# Notice the inclusion here, after setting the cpack variables.
include (CPack)

# Uninstall.

configure_file (
    "${CMAKE_CURRENT_SOURCE_DIR}/uninstall.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
    IMMEDIATE @ONLY
)

add_custom_target (
    uninstall
    "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
)



{'fraction_non_alphanumeric': 0.11574733096085409, 'fraction_numerical': 0.006761565836298933, 'mean_word_length': 4.412132883967261, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '293533', 'n_tokens_mistral': 4306, 'n_tokens_neox': 4118, 'n_words': 858}