<commit_before>CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT("peelo-cpp" CXX)

INCLUDE(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(cstdint PEELO_HAVE_CSTDINT)
IF (NOT PEELO_HAVE_CSTDINT)
    CHECK_INCLUDE_FILE_CXX(stdint.h PEELO_HAVE_STDINT_H)
ENDIF()

CONFIGURE_FILE(
    ${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.in
    ${CMAKE_CURRENT_SOURCE_DIR}/include/peelo/config.hpp
)

SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})

ADD_LIBRARY(
    peelo-cpp
    src/chrono/date.cpp
    src/chrono/datetime.cpp
    src/chrono/duration.cpp
    src/chrono/month.cpp
    src/chrono/time.cpp
    src/chrono/weekday.cpp
    src/io/filename.cpp
    src/io/filepath.cpp
    src/net/uri.cpp
    src/number/ratio.cpp
    src/text/rune.cpp
    src/text/string.cpp
    src/text/stringbuilder.cpp
)

INSTALL(
    DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/peelo
    DESTINATION include
    FILES_MATCHING PATTERN "*.hpp"
)
INSTALL(
    TARGETS peelo-cpp ARCHIVE DESTINATION lib
)

ENABLE_TESTING()
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/test TEST_SRCS)
FOREACH(i ${TEST_SRCS})
    GET_FILENAME_COMPONENT(name ${i} NAME_WE)
    ADD_EXECUTABLE(${name} ${i})
    TARGET_LINK_LIBRARIES(${name} peelo-cpp)
    ADD_TEST(${name} ${EXECUTABLE_OUTPUT_PATH}/${name})<commit_msg>forgot to add complex.cpp on CMakeLists.txt<commit_after>CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT("peelo-cpp" CXX)

INCLUDE(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(cstdint PEELO_HAVE_CSTDINT)
IF (NOT PEELO_HAVE_CSTDINT)
    CHECK_INCLUDE_FILE_CXX(stdint.h PEELO_HAVE_STDINT_H)
ENDIF()

CONFIGURE_FILE(
    ${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.in
    ${CMAKE_CURRENT_SOURCE_DIR}/include/peelo/config.hpp
)

SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})

ADD_LIBRARY(
    peelo-cpp
    src/chrono/date.cpp
    src/chrono/datetime.cpp
    src/chrono/duration.cpp
    src/chrono/month.cpp
    src/chrono/time.cpp
    src/chrono/weekday.cpp
    src/io/filename.cpp
    src/io/filepath.cpp
    src/net/uri.cpp
    src/number/complex.cpp
    src/number/ratio.cpp
    src/text/rune.cpp
    src/text/string.cpp
    src/text/stringbuilder.cpp
)

INSTALL(
    DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/peelo
    DESTINATION include
    FILES_MATCHING PATTERN "*.hpp"
)
INSTALL(
    TARGETS peelo-cpp ARCHIVE DESTINATION lib
)

ENABLE_TESTING()
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/test TEST_SRCS)
FOREACH(i ${TEST_SRCS})
    GET_FILENAME_COMPONENT(name ${i} NAME_WE)
    ADD_EXECUTABLE(${name} ${i})
    TARGET_LINK_LIBRARIES(${name} peelo-cpp)
    ADD_TEST(${name} ${EXECUTABLE_OUTPUT_PATH}/${name})
{'fraction_non_alphanumeric': 0.11288641889544981, 'fraction_numerical': 0.0013893713094824591, 'mean_word_length': 4.925925925925926, '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': '1248300', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1127, 'n_words': 135}