<commit_before>cmake_minimum_required(VERSION 3.1.3)
project(BPHash CXX)

# Enable testing?
enable_testing()

# Options to set
# By default, use C++14 compilation
set(CMAKE_CXX_EXTENSIONS False CACHE BOOL "Enable/Disable compiler-specific C++ extensions")
set(CMAKE_CXX_STANDARD 14 CACHE STRING "Which C++ standard to use")
set(BPHASH_BUILD_SHARED FALSE CACHE BOOL "Build a shared library, rather than a static library")
set(BPHASH_BUILD_PIC FALSE CACHE BOOL "Build the static library with PIC enabled")

# CMake doesn't support Intel CXX standard until cmake 3.6
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
  if("${CMAKE_VERSION}" VERSION_LESS "3.6")
      add_compile_options(-std=c++${CMAKE_CXX_STANDARD})
  endif()
endif()


# Set up the library type. This variable is passed to add_library
set(BPHASH_BUILD_TYPE "STATIC")
if(BPHASH_BUILD_SHARED)
  set(BPHASH_BUILD_TYPE "SHARED")
endif()


# Set the compile options
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
    add_compile_options(-w3)

    #   383  : value copied to temporary, reference to temporary used
    #   981  : operands are evaluated in unspecified order
    #  1418  : external function definition with no prior declaration
    add_compile_options(-wd383)
    add_compile_options(-wd981)
    add_compile_options(-wd1418)
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
    add_compile_options(-Wall;-Wextra;-pedantic)
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
    add_compile_options(-Wall;-Wextra;-pedantic)

    # for heavy-duty testing
    add_compile_options(-Weverything)
    add_compile_options(-Wno-c++98-compat)
    add_compile_options(-Wno-c++98-compat-pedantic)
    add_compile_options(-Wno-implicit-fallthrough)
    add_compile_options(-Wno-padded)
    add_compile_options(-Wno-weak-vtables)
    add_compile_options(-Wno-covered-switch-default)
endif()

# The main subdirectory with the bphash library
add_subdirectory(bphash)

# Directory with some tests
add_subdirectory(test)


# Create and install the config file
configure_file("bphashConfig.cmake.in" "bphashConfig.cmake" @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/bphashConfig.cmake DESTINATION lib/cmake/bphash) <commit_msg>Install cmake config to share rather than lib<commit_after>cmake_minimum_required(VERSION 3.1.3)
project(BPHash CXX)

# Enable testing?
enable_testing()

# Options to set
# By default, use C++14 compilation
set(CMAKE_CXX_EXTENSIONS False CACHE BOOL "Enable/Disable compiler-specific C++ extensions")
set(CMAKE_CXX_STANDARD 14 CACHE STRING "Which C++ standard to use")
set(BPHASH_BUILD_SHARED FALSE CACHE BOOL "Build a shared library, rather than a static library")
set(BPHASH_BUILD_PIC FALSE CACHE BOOL "Build the static library with PIC enabled")

# CMake doesn't support Intel CXX standard until cmake 3.6
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
  if("${CMAKE_VERSION}" VERSION_LESS "3.6")
      add_compile_options(-std=c++${CMAKE_CXX_STANDARD})
  endif()
endif()


# Set up the library type. This variable is passed to add_library
set(BPHASH_BUILD_TYPE "STATIC")
if(BPHASH_BUILD_SHARED)
  set(BPHASH_BUILD_TYPE "SHARED")
endif()


# Set the compile options
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
    add_compile_options(-w3)

    #   383  : value copied to temporary, reference to temporary used
    #   981  : operands are evaluated in unspecified order
    #  1418  : external function definition with no prior declaration
    add_compile_options(-wd383)
    add_compile_options(-wd981)
    add_compile_options(-wd1418)
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
    add_compile_options(-Wall;-Wextra;-pedantic)
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
    add_compile_options(-Wall;-Wextra;-pedantic)

    # for heavy-duty testing
    add_compile_options(-Weverything)
    add_compile_options(-Wno-c++98-compat)
    add_compile_options(-Wno-c++98-compat-pedantic)
    add_compile_options(-Wno-implicit-fallthrough)
    add_compile_options(-Wno-padded)
    add_compile_options(-Wno-weak-vtables)
    add_compile_options(-Wno-covered-switch-default)
endif()

# The main subdirectory with the bphash library
add_subdirectory(bphash)

# Directory with some tests
add_subdirectory(test)


# Create and install the config file
configure_file("bphashConfig.cmake.in" "bphashConfig.cmake" @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/bphashConfig.cmake DESTINATION share/cmake/bphash) 
{'fraction_non_alphanumeric': 0.09981768459434823, 'fraction_numerical': 0.016408386508659983, 'mean_word_length': 5.492603550295858, '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': '6292000', 'n_tokens_mistral': 1614, 'n_tokens_neox': 1501, 'n_words': 349}