<commit_before>cmake_minimum_required(VERSION 3.6)

project(algae VERSION 0.1 LANGUAGES CXX)

add_library(algae INTERFACE)

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

target_compile_features(algae INTERFACE cxx_std_17)

if(MSVC)
  target_compile_options(algae
    INTERFACE
      /D_SCL_SECURE_NO_WARNINGS
      /permissive-)
endif()

add_executable(algae_calc
  source/main.cpp)

target_link_libraries(algae_calc algae)

target_compile_features(algae_calc PUBLIC cxx_std_17)

target_include_directories(algae_calc
  PRIVATE
    source)

if(MSVC)
  # hack to deal with cmake automatically inserting /W3; stolen from llvm
  string(REGEX REPLACE " /W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
  string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

  target_compile_options(algae_calc
    PRIVATE
      /W4
      /WX)
else()
  target_compile_options(algae_calc
    PRIVATE
      -Wall
      -Wextra
      -pedantic
      -Werror)
endif()

### TESTING ###

add_executable(algae_test
  test/main.cpp
  test/vector.cpp)

target_link_libraries(algae_test algae)
target_include_directories(algae_test
  PRIVATE
    test)<commit_msg>change cmakelists.txt slightly<commit_after>cmake_minimum_required(VERSION 3.6)

project(algae VERSION 0.1 LANGUAGES CXX)

### LIBRARY ###

add_library(algae INTERFACE)

target_include_directories(algae
  INTERFACE
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    $<INSTALL_INTERFACE:include>)
target_compile_features(algae INTERFACE cxx_std_17)
if(MSVC)
  target_compile_options(algae
    INTERFACE
      /D_SCL_SECURE_NO_WARNINGS
      /permissive-)
endif()

### EXECUTABLE (for homework) ###

add_executable(algae_calc
  source/main.cpp)

target_link_libraries(algae_calc algae)
target_compile_features(algae_calc PUBLIC cxx_std_17)
target_include_directories(algae_calc
  PRIVATE
    source)


### TESTING ###

add_executable(algae_test
  test/main.cpp
  test/vector.cpp)
target_link_libraries(algae_test algae)
target_include_directories(algae_test
  PRIVATE
    test)

### FLAGS ###

if(MSVC)
  # hack to deal with cmake automatically inserting /W3; stolen from llvm
  string(REGEX REPLACE " /W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
  string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()

function(add_flags to)
  if(MSVC)
    target_compile_options(${to}
      PRIVATE
        /W4
        /WX)
  else()
    target_compile_options(${to}
      PRIVATE
        -Wall
        -Wextra
        -pedantic
        -Werror)
  endif()
endfunction()

add_flags(algae_calc)
add_flags(algae_test)

{'fraction_non_alphanumeric': 0.09738805970149254, 'fraction_numerical': 0.010447761194029851, 'mean_word_length': 4.527835051546392, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1820278', 'n_tokens_mistral': 1090, 'n_tokens_neox': 1006, 'n_words': 163}