<commit_before># Gets the libcouchbase version
# Sets:
#  LCB_VERSION: Version string
#  LCB_CHANGESET: SCM Revision number
#  LCB_VERSION_HEX Numeric hex version
#  LCB_VERSION_MAJOR
#  LCB_VERSION_MINOR
#  LCB_VERSION_PATCH

## Try git first ##
FIND_PROGRAM(GIT_EXECUTABLE NAMES git git.exe)
MACRO(RUNGIT outvar)
    EXECUTE_PROCESS(COMMAND git ${ARGN}
        OUTPUT_VARIABLE ${outvar}
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
        OUTPUT_STRIP_TRAILING_WHITESPACE)
ENDMACRO()

if (GIT_EXECUTABLE AND NOT LCB_SKIP_GIT_VERSION)
    RUNGIT(LCB_REVDESCRIBE describe --long --abbrev=10)
    RUNGIT(LCB_VERSION describe --abbrev=10)
    STRING(REPLACE "-" "_" LCB_VERSION "${LCB_VERSION}")
    MESSAGE(STATUS "Sanitized VERSION=${LCB_VERSION}")
    RUNGIT(LCB_VERSION_CHANGESET rev-parse HEAD)

    EXECUTE_PROCESS(
        COMMAND echo ${LCB_VERSION}
        COMMAND awk -F. "{printf \"0x%0.2d%0.2d%0.2d\", $1, $2, $3}"
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
        OUTPUT_VARIABLE LCB_VERSION_HEX)
ENDIF()

IF(LCB_VERSION)
    # Have the version information
    CONFIGURE_FILE(${LCB_GENINFODIR}/distinfo.cmake.in ${LCB_GENINFODIR}/distinfo.cmake)
ENDIF()

# library version
IF(NOT LCB_VERSION AND EXISTS ${LCB_GENINFODIR}/distinfo.cmake)
    INCLUDE(${LCB_GENINFODIR}/distinfo.cmake)
ENDIF()

IF (NOT LCB_VERSION)
    SET(LCB_NOGITVERSION ON)
    SET(LCB_VERSION "2.10.3")
ENDIF()
IF (NOT LCB_VERSION_CHANGESET)
    SET(LCB_VERSION_CHANGESET "0xdeadbeef")
ENDIF()
IF (NOT LCB_VERSION_HEX)
    SET(LCB_VERSION_HEX 0x021002)
ENDIF()

# Now parse the version string
STRING(REPLACE "." ";" LCB_VERSION_LIST "${LCB_VERSION}")
LIST(GET LCB_VERSION_LIST 0 LCB_VERSION_MAJOR)
LIST(GET LCB_VERSION_LIST 1 LCB_VERSION_MINOR)
LIST(GET LCB_VERSION_LIST 2 LCB_VERSION_PATCH)

# Determine the SONAME for the library
IF(APPLE)
    SET(LCB_SONAME_MAJOR "3")
ELSE()
    SET(LCB_SONAME_MAJOR "2")
ENDIF()
SET(LCB_SONAME_FULL "${LCB_SONAME_MAJOR}.0.65")

MESSAGE(STATUS
    "libcouchbase ${LCB_VERSION_MAJOR},${LCB_VERSION_MINOR},${LCB_VERSION_PATCH}")
MESSAGE(STATUS "Building libcouchbase ${LCB_VERSION}/${LCB_VERSION_CHANGESET}")<commit_msg>Bump ABI major version as further changes are going to break it<commit_after># Gets the libcouchbase version
# Sets:
#  LCB_VERSION: Version string
#  LCB_CHANGESET: SCM Revision number
#  LCB_VERSION_HEX Numeric hex version
#  LCB_VERSION_MAJOR
#  LCB_VERSION_MINOR
#  LCB_VERSION_PATCH

## Try git first ##
FIND_PROGRAM(GIT_EXECUTABLE NAMES git git.exe)
MACRO(RUNGIT outvar)
    EXECUTE_PROCESS(COMMAND git ${ARGN}
        OUTPUT_VARIABLE ${outvar}
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
        OUTPUT_STRIP_TRAILING_WHITESPACE)
ENDMACRO()

if (GIT_EXECUTABLE AND NOT LCB_SKIP_GIT_VERSION)
    RUNGIT(LCB_REVDESCRIBE describe --long --abbrev=10)
    RUNGIT(LCB_VERSION describe --abbrev=10)
    STRING(REPLACE "-" "_" LCB_VERSION "${LCB_VERSION}")
    MESSAGE(STATUS "Sanitized VERSION=${LCB_VERSION}")
    RUNGIT(LCB_VERSION_CHANGESET rev-parse HEAD)

    EXECUTE_PROCESS(
        COMMAND echo ${LCB_VERSION}
        COMMAND awk -F. "{printf \"0x%0.2d%0.2d%0.2d\", $1, $2, $3}"
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
        OUTPUT_VARIABLE LCB_VERSION_HEX)
ENDIF()

IF(LCB_VERSION)
    # Have the version information
    CONFIGURE_FILE(${LCB_GENINFODIR}/distinfo.cmake.in ${LCB_GENINFODIR}/distinfo.cmake)
ENDIF()

# library version
IF(NOT LCB_VERSION AND EXISTS ${LCB_GENINFODIR}/distinfo.cmake)
    INCLUDE(${LCB_GENINFODIR}/distinfo.cmake)
ENDIF()

IF (NOT LCB_VERSION)
    SET(LCB_NOGITVERSION ON)
    SET(LCB_VERSION "3.0.0")
ENDIF()
IF (NOT LCB_VERSION_CHANGESET)
    SET(LCB_VERSION_CHANGESET "0xdeadbeef")
ENDIF()
IF (NOT LCB_VERSION_HEX)
    SET(LCB_VERSION_HEX 0x030000)
ENDIF()

# Now parse the version string
STRING(REPLACE "." ";" LCB_VERSION_LIST "${LCB_VERSION}")
LIST(GET LCB_VERSION_LIST 0 LCB_VERSION_MAJOR)
LIST(GET LCB_VERSION_LIST 1 LCB_VERSION_MINOR)
LIST(GET LCB_VERSION_LIST 2 LCB_VERSION_PATCH)

# Determine the SONAME for the library
IF(APPLE)
    SET(LCB_SONAME_MAJOR "4")
ELSE()
    SET(LCB_SONAME_MAJOR "3")
ENDIF()
SET(LCB_SONAME_FULL "${LCB_SONAME_MAJOR}.0.1")

MESSAGE(STATUS
    "libcouchbase ${LCB_VERSION_MAJOR},${LCB_VERSION_MINOR},${LCB_VERSION_PATCH}")
MESSAGE(STATUS "Building libcouchbase ${LCB_VERSION}/${LCB_VERSION_CHANGESET}")
{'fraction_non_alphanumeric': 0.10880590133702167, 'fraction_numerical': 0.015214384508990318, 'mean_word_length': 5.252161383285302, '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': '4759344', 'n_tokens_mistral': 1820, 'n_tokens_neox': 1744, 'n_words': 320}