<commit_before>cmake_minimum_required(VERSION 3.2)
project(shrinkwrap VERSION 1.1.0)

include(CMakePackageConfigHelpers)

set(CMAKE_CXX_STANDARD 11)

#find_library(LIBLZMA_LIBRARIES
#             NAMES liblzma.a lzma)
#
#find_library(ZLIB_LIBRARIES
#             NAMES libz.a z)
#
#find_library(ZSTD_LIBRARIES
#             NAMES libzstd.a zstd)

list(PREPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)

find_library(LIBLZMA_LIBRARIES lzma)

find_library(ZLIB_LIBRARIES z)

find_library(ZSTD_LIBRARIES zstd)

if (NOT LIBLZMA_LIBRARIES)
    message(WARNING "lzma library not found")
endif()

if (NOT ZLIB_LIBRARIES)
    message(WARNING "zlib library not found")
endif()

if (NOT ZSTD_LIBRARIES)
    message(WARNING "zstd library not found")
endif()

add_library(shrinkwrap INTERFACE)
if (CMAKE_VERSION VERSION_GREATER 3.3)
    target_sources(shrinkwrap INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/shrinkwrap/stdio.hpp;${CMAKE_CURRENT_SOURCE_DIR}/include/shrinkwrap/xz.hpp;${CMAKE_CURRENT_SOURCE_DIR}/include/shrinkwrap/gz.hpp;${CMAKE_CURRENT_SOURCE_DIR}/include/shrinkwrap/zstd.hpp;${CMAKE_CURRENT_SOURCE_DIR}/include/shrinkwrap/istream.hpp>)
    target_include_directories(shrinkwrap INTERFACE
                               $<INSTALL_INTERFACE:include>
                               $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
    target_link_libraries(shrinkwrap INTERFACE ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES} ${ZSTD_LIBRARIES})

    if (BUILD_TESTS)
        add_executable(shrinkwrap-test src/test.cpp)
        target_link_libraries(shrinkwrap-test shrinkwrap)
    endif()
else()
    if (BUILD_TESTS)<commit_msg>Fix for older versions of CMake.<commit_after>cmake_minimum_required(VERSION 3.2)
project(shrinkwrap VERSION 1.1.0)

include(CMakePackageConfigHelpers)

set(CMAKE_CXX_STANDARD 11)

find_library(LIBLZMA_LIBRARIES
             NAMES liblzma.a lzma)

find_library(ZLIB_LIBRARIES
             NAMES libz.a z)

find_library(ZSTD_LIBRARIES
             NAMES libzstd.a zstd)

#list(PREPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)
#
#find_library(LIBLZMA_LIBRARIES lzma)
#
#find_library(ZLIB_LIBRARIES z)
#
#find_library(ZSTD_LIBRARIES zstd)

if (NOT LIBLZMA_LIBRARIES)
    message(WARNING "lzma library not found")
endif()

if (NOT ZLIB_LIBRARIES)
    message(WARNING "zlib library not found")
endif()

if (NOT ZSTD_LIBRARIES)
    message(WARNING "zstd library not found")
endif()

add_library(shrinkwrap INTERFACE)
if (CMAKE_VERSION VERSION_GREATER 3.3)
    target_sources(shrinkwrap INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/shrinkwrap/stdio.hpp;${CMAKE_CURRENT_SOURCE_DIR}/include/shrinkwrap/xz.hpp;${CMAKE_CURRENT_SOURCE_DIR}/include/shrinkwrap/gz.hpp;${CMAKE_CURRENT_SOURCE_DIR}/include/shrinkwrap/zstd.hpp;${CMAKE_CURRENT_SOURCE_DIR}/include/shrinkwrap/istream.hpp>)
    target_include_directories(shrinkwrap INTERFACE
                               $<INSTALL_INTERFACE:include>
                               $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
    target_link_libraries(shrinkwrap INTERFACE ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES} ${ZSTD_LIBRARIES})

    if (BUILD_TESTS)
        add_executable(shrinkwrap-test src/test.cpp)
        target_link_libraries(shrinkwrap-test shrinkwrap)
    endif()
else()
    if (BUILD_TESTS)
{'fraction_non_alphanumeric': 0.09405339805825243, 'fraction_numerical': 0.0054611650485436895, 'mean_word_length': 4.7539267015706805, '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': '1145857', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1186, 'n_words': 172}