<commit_before>cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

project(rttest)

if(WIN32 OR APPLE)
  message(STATUS "rttest is only supported on Linux, skipping...")
  return()
endif()

set(CMAKE_CXX_FLAGS "-std=c++11")

find_package(ament_cmake QUIET)

# ament build if it was found
if(${ament_cmake_FOUND})
  find_package(Threads REQUIRED)

  include_directories(rttest ${PROJECT_SOURCE_DIR}/include/rttest)
  add_library(rttest SHARED ${PROJECT_SOURCE_DIR}/src/rttest.cpp)
  target_link_libraries(rttest m stdc++ ${CMAKE_THREAD_LIBS_INIT})

  ament_export_include_directories(include)
  ament_export_libraries(rttest pthread)

  if(AMENT_ENABLE_TESTING)
    find_package(ament_cmake_gtest REQUIRED)
    find_package(ament_lint_auto REQUIRED)
    ament_lint_auto_find_test_dependencies()

    ament_add_gtest(
      gtest_rttest_api
      "test/test_api.cpp"
      TIMEOUT 15
    )
    if(TARGET gtest_rttest_api)
      target_link_libraries(gtest_rttest_api
        ${_AMENT_EXPORT_ABSOLUTE_LIBRARIES}
        ${_AMENT_EXPORT_LIBRARY_TARGETS})
      add_dependencies(gtest_rttest_api ${PROJECT_NAME})
      ament_target_dependencies(gtest_rttest_api "rttest")
    endif()
  endif()

  ament_package()

  install(
    DIRECTORY include/
    DESTINATION include
  )

  install(
    DIRECTORY scripts/
    DESTINATION bin
  )

  install(
    TARGETS rttest
    ARCHIVE DESTINATION lib
    LIBRARY DESTINATION lib
  )

else()
  message(STATUS "ament_cmake_auto not found, executing pure CMake build")
  # pure cmake build
  set(INSTALL_LIB_DIR lib CACHE PATH "install dir for libraries")
  set(INSTALL_BIN_DIR bin CACHE PATH "install dir for executables")
  set(INSTALL_INCLUDE_DIR include/rttest CACHE PATH "install dir for headers")

  set(DEF_INSTALL_CMAKE_DIR lib/cmake/rttest)
  set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "install dir for cmake files")

  find_package(Threads REQUIRED)
  add_library(rttest ${PROJECT_SOURCE_DIR}/src/rttest.cpp)
  target_link_libraries(rttest m stdc++ ${CMAKE_THREAD_LIBS_INIT})

  include_directories(rttest ${PROJECT_SOURCE_DIR}/include/rttest)

  install(TARGETS rttest
    LIBRARY DESTINATION ${INSTALL_LIB_DIR}
    ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
  )

  install(FILES ${PROJECT_SOURCE_DIR}/include/rttest/rttest.h ${PROJECT_SOURCE_DIR}/include/rttest/utils.h DESTINATION ${INSTALL_INCLUDE_DIR})

  export(PACKAGE ${PROJECT_NAME})

  set(rttest_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)
  set(rttest_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib)
  set(rttest_CMAKE_DIR
    ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/CMake)
  configure_file(${CMAKE_PROJECT_NAME}Config.cmake.in
    ${CMAKE_BINARY_DIR}/InstallFiles/${CMAKE_PROJECT_NAME}Config.cmake
    @ONLY)
  install(FILES
    ${CMAKE_BINARY_DIR}/InstallFiles/${CMAKE_PROJECT_NAME}Config.cmake
    DESTINATION ${rttest_CMAKE_DIR})

endif()
<commit_msg>Install rttest_plot as a program<commit_after>cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

project(rttest)

if(WIN32 OR APPLE)
  message(STATUS "rttest is only supported on Linux, skipping...")
  return()
endif()

set(CMAKE_CXX_FLAGS "-std=c++11")

find_package(ament_cmake QUIET)

# ament build if it was found
if(${ament_cmake_FOUND})
  find_package(Threads REQUIRED)

  include_directories(rttest ${PROJECT_SOURCE_DIR}/include/rttest)
  add_library(rttest SHARED ${PROJECT_SOURCE_DIR}/src/rttest.cpp)
  target_link_libraries(rttest m stdc++ ${CMAKE_THREAD_LIBS_INIT})

  ament_export_include_directories(include)
  ament_export_libraries(rttest pthread)

  if(AMENT_ENABLE_TESTING)
    find_package(ament_cmake_gtest REQUIRED)
    find_package(ament_lint_auto REQUIRED)
    ament_lint_auto_find_test_dependencies()

    ament_add_gtest(
      gtest_rttest_api
      "test/test_api.cpp"
      TIMEOUT 15
    )
    if(TARGET gtest_rttest_api)
      target_link_libraries(gtest_rttest_api
        ${_AMENT_EXPORT_ABSOLUTE_LIBRARIES}
        ${_AMENT_EXPORT_LIBRARY_TARGETS})
      add_dependencies(gtest_rttest_api ${PROJECT_NAME})
      ament_target_dependencies(gtest_rttest_api "rttest")
    endif()
  endif()

  ament_package()

  install(
    DIRECTORY include/
    DESTINATION include
  )

  install(
    PROGRAMS scripts/rttest_plot
    DESTINATION bin
  )

  install(
    TARGETS rttest
    ARCHIVE DESTINATION lib
    LIBRARY DESTINATION lib
  )

else()
  message(STATUS "ament_cmake_auto not found, executing pure CMake build")
  # pure cmake build
  set(INSTALL_LIB_DIR lib CACHE PATH "install dir for libraries")
  set(INSTALL_BIN_DIR bin CACHE PATH "install dir for executables")
  set(INSTALL_INCLUDE_DIR include/rttest CACHE PATH "install dir for headers")

  set(DEF_INSTALL_CMAKE_DIR lib/cmake/rttest)
  set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "install dir for cmake files")

  find_package(Threads REQUIRED)
  add_library(rttest ${PROJECT_SOURCE_DIR}/src/rttest.cpp)
  target_link_libraries(rttest m stdc++ ${CMAKE_THREAD_LIBS_INIT})

  include_directories(rttest ${PROJECT_SOURCE_DIR}/include/rttest)

  install(TARGETS rttest
    LIBRARY DESTINATION ${INSTALL_LIB_DIR}
    ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
  )

  install(FILES ${PROJECT_SOURCE_DIR}/include/rttest/rttest.h ${PROJECT_SOURCE_DIR}/include/rttest/utils.h DESTINATION ${INSTALL_INCLUDE_DIR})

  export(PACKAGE ${PROJECT_NAME})

  set(rttest_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)
  set(rttest_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib)
  set(rttest_CMAKE_DIR
    ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/CMake)
  configure_file(${CMAKE_PROJECT_NAME}Config.cmake.in
    ${CMAKE_BINARY_DIR}/InstallFiles/${CMAKE_PROJECT_NAME}Config.cmake
    @ONLY)
  install(FILES
    ${CMAKE_BINARY_DIR}/InstallFiles/${CMAKE_PROJECT_NAME}Config.cmake
    DESTINATION ${rttest_CMAKE_DIR})

endif()

{'fraction_non_alphanumeric': 0.08903516369305386, 'fraction_numerical': 0.002771522605231249, 'mean_word_length': 5.3520352035203524, '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': '2074787', 'n_tokens_mistral': 2299, 'n_tokens_neox': 2055, 'n_words': 344}