<commit_before>file (GLOB COMMON_SOURCE_FILES "common/*.cc")
file (GLOB SERVER_SOURCE_FILES "server/*.cc")
file (GLOB CLIENT_SOURCE_FILES "client/*.cc")

file (GLOB INCLUDE_FILES ${PROJECT_SOURCE_DIR}/include/pistache/*h)

set(SOURCE_FILES
    ${COMMON_SOURCE_FILES}
    ${SERVER_SOURCE_FILES}
    ${CLIENT_SOURCE_FILES}
    ${INCLUDE_FILES}
)

add_library(pistache OBJECT ${SOURCE_FILES})
set_target_properties(pistache PROPERTIES POSITION_INDEPENDENT_CODE 1)
add_definitions(-DONLY_C_LOCALE=1)

target_include_directories(pistache PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)

set(include_install_dir "include")
set(lib_install_dir "lib/")
set(bin_install_dir "bin/")

add_library(pistache_shared SHARED $<TARGET_OBJECTS:pistache>)
add_library(pistache_static STATIC $<TARGET_OBJECTS:pistache>)

target_link_libraries(pistache_shared pthread)
target_link_libraries(pistache_static pthread)

set_target_properties(pistache_shared PROPERTIES
    OUTPUT_NAME "pistache"
    VERSION ${version}
    SOVERSION ${VERSION_MAJOR}
)

set_target_properties(pistache_static PROPERTIES OUTPUT_NAME "pistache")

if (PISTACHE_INSTALL)
    install(
      TARGETS pistache_shared
      EXPORT ${targets_export_name}
      ARCHIVE DESTINATION ${lib_install_dir}
      LIBRARY DESTINATION ${lib_install_dir}
      RUNTIME DESTINATION ${bin_install_dir}
      INCLUDES DESTINATION ${include_install_dir})

    install(
      DIRECTORY "${PROJECT_SOURCE_DIR}/include/pistache"
      DESTINATION ${include_install_dir}
      FILES_MATCHING PATTERN "*.*h")
    install(TARGETS pistache_static
            EXPORT PistacheTargets
            DESTINATION lib)
    install(EXPORT PistacheTargets
            DESTINATION "lib/cmake/pistache"
            EXPORT_LINK_INTERFACE_LIBRARIES
            COMPONENT cmake-config
    )

    include(CMakePackageConfigHelpers)
    configure_package_config_file(
        "PistacheConfig.cmake.in"
        "${CMAKE_CURRENT_BINARY_DIR}/PistacheConfig.cmake"
        INSTALL_DESTINATION "lib/cmake/pistache"
    )
    install(
        FILES "${CMAKE_CURRENT_BINARY_DIR}/PistacheConfig.cmake"
        DESTINATION "lib/cmake/pistache"<commit_msg>clean: introducing the variables Pistache_OUTPUT_NAME, Pistache_CMAKE_INSTALL_PATH, Pistache_CONFIG_FILE to reduce possible typo errors<commit_after>file (GLOB COMMON_SOURCE_FILES "common/*.cc")
file (GLOB SERVER_SOURCE_FILES "server/*.cc")
file (GLOB CLIENT_SOURCE_FILES "client/*.cc")

file (GLOB INCLUDE_FILES ${PROJECT_SOURCE_DIR}/include/pistache/*h)

set(SOURCE_FILES
    ${COMMON_SOURCE_FILES}
    ${SERVER_SOURCE_FILES}
    ${CLIENT_SOURCE_FILES}
    ${INCLUDE_FILES}
)

add_library(pistache OBJECT ${SOURCE_FILES})
set_target_properties(pistache PROPERTIES POSITION_INDEPENDENT_CODE 1)
add_definitions(-DONLY_C_LOCALE=1)

target_include_directories(pistache PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)

set(include_install_dir "include")
set(lib_install_dir "lib/")
set(bin_install_dir "bin/")

add_library(pistache_shared SHARED $<TARGET_OBJECTS:pistache>)
add_library(pistache_static STATIC $<TARGET_OBJECTS:pistache>)

target_link_libraries(pistache_shared pthread)
target_link_libraries(pistache_static pthread)

set(Pistache_OUTPUT_NAME "pistache")
set_target_properties(pistache_shared PROPERTIES
    OUTPUT_NAME ${Pistache_OUTPUT_NAME}
    VERSION ${version}
    SOVERSION ${VERSION_MAJOR}
)

set_target_properties(pistache_static PROPERTIES 
    OUTPUT_NAME ${Pistache_OUTPUT_NAME}
)

if (PISTACHE_INSTALL)
    set(Pistache_CMAKE_INSTALL_PATH "lib/cmake/pistache")
    set(Pistache_CONFIG_FILE "PistacheConfig.cmake")

    install(
      TARGETS pistache_shared
      EXPORT ${targets_export_name}
      ARCHIVE DESTINATION ${lib_install_dir}
      LIBRARY DESTINATION ${lib_install_dir}
      RUNTIME DESTINATION ${bin_install_dir}
      INCLUDES DESTINATION ${include_install_dir})

    install(
      DIRECTORY "${PROJECT_SOURCE_DIR}/include/pistache"
      DESTINATION ${include_install_dir}
      FILES_MATCHING PATTERN "*.*h")
    install(TARGETS pistache_static
            EXPORT PistacheTargets
            DESTINATION lib)
    install(EXPORT PistacheTargets
            DESTINATION ${Pistache_CMAKE_INSTALL_PATH}
            EXPORT_LINK_INTERFACE_LIBRARIES
            COMPONENT cmake-config
    )

    include(CMakePackageConfigHelpers)
    configure_package_config_file(
        "${Pistache_CONFIG_FILE}.in"
        "${CMAKE_CURRENT_BINARY_DIR}/${Pistache_CONFIG_FILE}"
        INSTALL_DESTINATION ${Pistache_CMAKE_INSTALL_PATH}
    )
    install(
        FILES "${CMAKE_CURRENT_BINARY_DIR}/${Pistache_CONFIG_FILE}"
        DESTINATION ${Pistache_CMAKE_INSTALL_PATH}
{'fraction_non_alphanumeric': 0.0861335601871544, 'fraction_numerical': 0.0008507018290089324, 'mean_word_length': 4.9607097591888465, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5067196', 'n_tokens_mistral': 1696, 'n_tokens_neox': 1597, 'n_words': 238}