<commit_before>########################################

if (NOT EXISTS ${BUILD_DIR})
    message(STATUS "Build dir does not exists for package ${PACKAGE_STRING} (${BUILD_DIR})")
    message(STATUS "Re-run cppan to fix this warning.")
    return()
endif()

set(REBUILD 1)

if (EXISTS ${fn1})
    file(READ ${fn1} f1)
    if (EXISTS ${fn2})
        file(READ ${fn2} f2)
        if ("${f1}" STREQUAL "${f2}")
            set(REBUILD 0)
        endif()
    else()
        file(WRITE ${fn2} "${f1}")
    endif()
endif()

set(TARGET_INFO_FILE ${BUILD_DIR}/cppan_target_info_${CONFIG}.cmake)

set(TARGET_FILE)
if (EXISTS ${TARGET_INFO_FILE})
    include(${TARGET_INFO_FILE})
endif()

message("1 - ${TARGET_FILE}")

if (NOT REBUILD AND EXISTS ${TARGET_FILE})
    message("2 - returning")
    return()
endif()

set(lock ${BUILD_DIR}/cppan_build.lock)

file(
    LOCK ${lock}
    # cannot make GUARD FILE here: https://gitlab.kitware.com/cmake/cmake/issues/16480
    #GUARD FILE # CMake bug workaround https://gitlab.kitware.com/cmake/cmake/issues/16295
    RESULT_VARIABLE lock_result
)
if (NOT ${lock_result} EQUAL 0)
    message(FATAL_ERROR "Lock error: ${lock_result}")
endif()

# double check
if (NOT REBUILD AND EXISTS ${TARGET_FILE})<commit_msg>Remove messages().<commit_after>########################################

if (NOT EXISTS ${BUILD_DIR})
    message(STATUS "Build dir does not exists for package ${PACKAGE_STRING} (${BUILD_DIR})")
    message(STATUS "Re-run cppan to fix this warning.")
    return()
endif()

set(REBUILD 1)

if (EXISTS ${fn1})
    file(READ ${fn1} f1)
    if (EXISTS ${fn2})
        file(READ ${fn2} f2)
        if ("${f1}" STREQUAL "${f2}")
            set(REBUILD 0)
        endif()
    else()
        file(WRITE ${fn2} "${f1}")
    endif()
endif()

set(TARGET_INFO_FILE ${BUILD_DIR}/cppan_target_info_${CONFIG}.cmake)

set(TARGET_FILE)
if (EXISTS ${TARGET_INFO_FILE})
    include(${TARGET_INFO_FILE})
endif()

if (NOT REBUILD AND EXISTS ${TARGET_FILE})
    return()
endif()

set(lock ${BUILD_DIR}/cppan_build.lock)

file(
    LOCK ${lock}
    # cannot make GUARD FILE here: https://gitlab.kitware.com/cmake/cmake/issues/16480
    #GUARD FILE # CMake bug workaround https://gitlab.kitware.com/cmake/cmake/issues/16295
    RESULT_VARIABLE lock_result
)
if (NOT ${lock_result} EQUAL 0)
    message(FATAL_ERROR "Lock error: ${lock_result}")
endif()

# double check
if (NOT REBUILD AND EXISTS ${TARGET_FILE})
{'fraction_non_alphanumeric': 0.18099547511312217, 'fraction_numerical': 0.01974496092143151, 'mean_word_length': 3.9430894308943087, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '2324414', 'n_tokens_mistral': 892, 'n_tokens_neox': 850, 'n_words': 214}