<commit_before>cmake_minimum_required(VERSION 3.1)

project(tsl_hopscotch_map VERSION 2.1.0)

add_library(hopscotch_map INTERFACE)
# Use tsl::hopscotch_map as target, more consistent with other libraries conventions (Boost, Qt, ...)
add_library(tsl::hopscotch_map ALIAS hopscotch_map)

target_include_directories(hopscotch_map INTERFACE
                           "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
                           "$<INSTALL_INTERFACE:include>")

list(APPEND headers "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/bhopscotch_map.h"
                    "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/bhopscotch_set.h"
                    "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_growth_policy.h"
                    "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_hash.h"
                    "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_map.h"
                    "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_set.h")
target_sources(hopscotch_map INTERFACE "$<BUILD_INTERFACE:${headers}>")

if(MSVC)
    target_sources(hopscotch_map INTERFACE
                   "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tsl_hopscotch_map.natvis>"
                   "$<INSTALL_INTERFACE:tsl_hopscotch_map.natvis>")
endif()

# Only compatible with CMake version >= 3.8
if(${CMAKE_VERSION} VERSION_GREATER "3.7")
    target_compile_features(hopscotch_map INTERFACE cxx_std_11)
endif()




# Installation (only compatible with CMake version >= 3.3)
if(${CMAKE_VERSION} VERSION_GREATER "3.2")
    include(CMakePackageConfigHelpers)
    include(GNUInstallDirs)

    ## Install include directory
    install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl"
            DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")



    ## Create and install tsl_hopscotch_mapConfig.cmake
    configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/tsl_hopscotch_mapConfig.cmake.in"
                                  "${CMAKE_CURRENT_BINARY_DIR}/tsl_hopscotch_mapConfig.cmake"
                                  INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/tsl_hopscotch_map")

    install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl_hopscotch_mapConfig.cmake"
            DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/tsl_hopscotch_map")
<commit_msg>On Windows, add tsl_hopscotch_map.natvis to the installed files.<commit_after>cmake_minimum_required(VERSION 3.1)

project(tsl_hopscotch_map VERSION 2.1.0)

add_library(hopscotch_map INTERFACE)
# Use tsl::hopscotch_map as target, more consistent with other libraries conventions (Boost, Qt, ...)
add_library(tsl::hopscotch_map ALIAS hopscotch_map)

target_include_directories(hopscotch_map INTERFACE
                           "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
                           "$<INSTALL_INTERFACE:include>")

list(APPEND headers "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/bhopscotch_map.h"
                    "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/bhopscotch_set.h"
                    "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_growth_policy.h"
                    "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_hash.h"
                    "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_map.h"
                    "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/hopscotch_set.h")
target_sources(hopscotch_map INTERFACE "$<BUILD_INTERFACE:${headers}>")

if(MSVC)
    target_sources(hopscotch_map INTERFACE
                   "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tsl_hopscotch_map.natvis>"
                   "$<INSTALL_INTERFACE:tsl_hopscotch_map.natvis>")
endif()

# Only compatible with CMake version >= 3.8
if(${CMAKE_VERSION} VERSION_GREATER "3.7")
    target_compile_features(hopscotch_map INTERFACE cxx_std_11)
endif()




# Installation (only compatible with CMake version >= 3.3)
if(${CMAKE_VERSION} VERSION_GREATER "3.2")
    include(CMakePackageConfigHelpers)
    include(GNUInstallDirs)

    ## Install include directory and potential natvis file
    install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl"
            DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

    if(MSVC)
        install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/tsl_hopscotch_map.natvis"
                DESTINATION ".")
    endif()



    ## Create and install tsl_hopscotch_mapConfig.cmake
    configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/tsl_hopscotch_mapConfig.cmake.in"
                                  "${CMAKE_CURRENT_BINARY_DIR}/tsl_hopscotch_mapConfig.cmake"
                                  INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/tsl_hopscotch_map")

    install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl_hopscotch_mapConfig.cmake"
            DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/tsl_hopscotch_map")

{'fraction_non_alphanumeric': 0.10077845571218177, 'fraction_numerical': 0.006311803071744161, 'mean_word_length': 3.6516634050880628, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1820290', 'n_tokens_mistral': 1717, 'n_tokens_neox': 1623, 'n_words': 190}