<commit_before># J-PET framework project main description file
#
# Author: <NAME> <<EMAIL>>
#
# Description:
#   Builds all J-PET framework modules using CMake build generator.

cmake_minimum_required(VERSION 2.6)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(JPetFramework-Utilities) # for generate_root_dictionaries

project(JPetFramework CXX C) # using only C++
# enable C++11 and warnings
if(NOT MSVC)
  add_definitions(-std=c++11 -Wall -Wunused-parameter)
endif()

foreach(mode QUIET REQUIRED)
  find_package(ROOT 5 ${mode} COMPONENTS
    Hist
    Physics
    RIO
    Thread
    Tree
    )
  if(ROOT_USE_FILE)
    include(${ROOT_USE_FILE})
  endif()
  if(ROOT_FOUND)
    break()
  endif()
  # if we failed with CMake based find_package, use fallback
  # root-config version from cmake/fallback/
  list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/fallback)
endforeach()
include_directories(${ROOT_INCLUDE_DIRS})
add_definitions(${ROOT_DEFINITIONS})
message(STATUS "ROOT version: ${ROOT_VERSION}")
if(ROOT_FOUND AND NOT ROOT_VERSION VERSION_LESS "6.0")
  message(FATAL_ERROR "ROOT 6.0 is not compatible")
endif()

find_package(PQXX REQUIRED)
include_directories(${PQXX_INCLUDE_DIRS})
add_definitions(${PQXX_DEFINITIONS})

find_package(Config++ REQUIRED)
include_directories(${CONFIG++_INCLUDE_DIRS})
add_definitions(${CONFIG++_DEFINITIONS})

find_package(TinyXML REQUIRED)
include_directories(${TINYXML_INCLUDE_DIRS})
add_definitions(${CONFIG++_DEFINITIONS})


find_package(Boost 1.50.0 REQUIRED COMPONENTS
  filesystem
  program_options
  regex
  system
  unit_test_framework
  )

include_directories(${Boost_INCLUDE_DIRS})
add_definitions(${Boost_DEFINITIONS})

get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
  # export ROOT, Boost and pqxx includes to depending projects
  set(Framework_INCLUDE_DIRS
    ${ROOT_INCLUDE_DIRS}
    ${Boost_INCLUDE_DIRS}
    ${PQXX_INCLUDE_DIRS}
    PARENT_SCOPE
    )
  set(Framework_DEFINITIONS
    ${ROOT_DEFINITIONS}
    ${Boost_DEFINITIONS}
    ${PQXX_DEFINITIONS}
    PARENT_SCOPE
    )
  # ensure that projects use C++11 too
  if(NOT MSVC)
    set(Framework_DEFINITIONS
      -std=c++11
      ${Framework_DEFINITIONS}
      PARENT_SCOPE
      )
  endif()
  # export ROOT cint needed to generate dictionaries from projects
  set(ROOT_rootcint_CMD   ${ROOT_rootcint_CMD}   PARENT_SCOPE)
  set(rootcint_cmd        ${ROOT_rootcint_CMD}   PARENT_SCOPE)
  set(ROOTCINT_EXECUTABLE ${ROOTCINT_EXECUTABLE} PARENT_SCOPE)
  # export ROOT rpath needed for OS X
  set(ROOT_LIBRARY_DIR    ${ROOT_LIBRARY_DIR}    PARENT_SCOPE)
endif()

# enable rpath on OS X and point it to ROOT
if(APPLE)
  set(CMAKE_MACOSX_RPATH ON)
  set(CMAKE_EXE_LINKER_FLAGS
    "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,${ROOT_LIBRARY_DIR}"
    )
endif()

# use rpath pointing to build directory
set(CMAKE_SKIP_BUILD_RPATH OFF)
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)

file(GLOB HEADERS JPet*/*.h tools/JPet*/*.h modules/JPet*/*.h)
file(GLOB SOURCES JPet*/*.cpp tools/JPet*/*.cpp modules/JPet*/*.cpp)
file(GLOB UNIT_TEST_SOURCES JPet*/*Test.cpp)
list(REMOVE_ITEM SOURCES ${UNIT_TEST_SOURCES})

##download test files and config files
#only once
set(DOWNLOAD_DATA ${CMAKE_CURRENT_SOURCE_DIR}/download_data.sh ${CMAKE_CURRENT_SOURCE_DIR})
if(NOT DOWNLOAD_DATA_HAPPENED)
  execute_process( COMMAND ${DOWNLOAD_DATA} )
  set(DOWNLOAD_DATA_HAPPENED TRUE CACHE BOOL "Has the download data happened?" FORCE)
endif() 
<commit_msg>Add modules/JPet*/*Test.cpp to unit tests source path in CMake<commit_after># J-PET framework project main description file
#
# Author: <NAME> <<EMAIL>>
#
# Description:
#   Builds all J-PET framework modules using CMake build generator.

cmake_minimum_required(VERSION 2.6)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(JPetFramework-Utilities) # for generate_root_dictionaries

project(JPetFramework CXX C) # using only C++
# enable C++11 and warnings
if(NOT MSVC)
  add_definitions(-std=c++11 -Wall -Wunused-parameter)
endif()

foreach(mode QUIET REQUIRED)
  find_package(ROOT 5 ${mode} COMPONENTS
    Hist
    Physics
    RIO
    Thread
    Tree
    )
  if(ROOT_USE_FILE)
    include(${ROOT_USE_FILE})
  endif()
  if(ROOT_FOUND)
    break()
  endif()
  # if we failed with CMake based find_package, use fallback
  # root-config version from cmake/fallback/
  list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/fallback)
endforeach()
include_directories(${ROOT_INCLUDE_DIRS})
add_definitions(${ROOT_DEFINITIONS})
message(STATUS "ROOT version: ${ROOT_VERSION}")
if(ROOT_FOUND AND NOT ROOT_VERSION VERSION_LESS "6.0")
  message(FATAL_ERROR "ROOT 6.0 is not compatible")
endif()

find_package(PQXX REQUIRED)
include_directories(${PQXX_INCLUDE_DIRS})
add_definitions(${PQXX_DEFINITIONS})

find_package(Config++ REQUIRED)
include_directories(${CONFIG++_INCLUDE_DIRS})
add_definitions(${CONFIG++_DEFINITIONS})

find_package(TinyXML REQUIRED)
include_directories(${TINYXML_INCLUDE_DIRS})
add_definitions(${CONFIG++_DEFINITIONS})


find_package(Boost 1.50.0 REQUIRED COMPONENTS
  filesystem
  program_options
  regex
  system
  unit_test_framework
  )

include_directories(${Boost_INCLUDE_DIRS})
add_definitions(${Boost_DEFINITIONS})

get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
  # export ROOT, Boost and pqxx includes to depending projects
  set(Framework_INCLUDE_DIRS
    ${ROOT_INCLUDE_DIRS}
    ${Boost_INCLUDE_DIRS}
    ${PQXX_INCLUDE_DIRS}
    PARENT_SCOPE
    )
  set(Framework_DEFINITIONS
    ${ROOT_DEFINITIONS}
    ${Boost_DEFINITIONS}
    ${PQXX_DEFINITIONS}
    PARENT_SCOPE
    )
  # ensure that projects use C++11 too
  if(NOT MSVC)
    set(Framework_DEFINITIONS
      -std=c++11
      ${Framework_DEFINITIONS}
      PARENT_SCOPE
      )
  endif()
  # export ROOT cint needed to generate dictionaries from projects
  set(ROOT_rootcint_CMD   ${ROOT_rootcint_CMD}   PARENT_SCOPE)
  set(rootcint_cmd        ${ROOT_rootcint_CMD}   PARENT_SCOPE)
  set(ROOTCINT_EXECUTABLE ${ROOTCINT_EXECUTABLE} PARENT_SCOPE)
  # export ROOT rpath needed for OS X
  set(ROOT_LIBRARY_DIR    ${ROOT_LIBRARY_DIR}    PARENT_SCOPE)
endif()

# enable rpath on OS X and point it to ROOT
if(APPLE)
  set(CMAKE_MACOSX_RPATH ON)
  set(CMAKE_EXE_LINKER_FLAGS
    "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,${ROOT_LIBRARY_DIR}"
    )
endif()

# use rpath pointing to build directory
set(CMAKE_SKIP_BUILD_RPATH OFF)
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)

file(GLOB HEADERS JPet*/*.h tools/JPet*/*.h modules/JPet*/*.h)
file(GLOB SOURCES JPet*/*.cpp tools/JPet*/*.cpp modules/JPet*/*.cpp)
file(GLOB UNIT_TEST_SOURCES JPet*/*Test.cpp)
file(GLOB MODULES_UNIT_TEST_SOURCES modules/JPet*/*Test.cpp)
list(APPEND UNIT_TEST_SOURCES ${MODULES_UNIT_TEST_SOURCES})
list(REMOVE_ITEM SOURCES ${UNIT_TEST_SOURCES})

##download test files and config files
#only once
set(DOWNLOAD_DATA ${CMAKE_CURRENT_SOURCE_DIR}/download_data.sh ${CMAKE_CURRENT_SOURCE_DIR})
if(NOT DOWNLOAD_DATA_HAPPENED)
  execute_process( COMMAND ${DOWNLOAD_DATA} )
  set(DOWNLOAD_DATA_HAPPENED TRUE CACHE BOOL "Has the download data happened?" FORCE)
endif() 

{'fraction_non_alphanumeric': 0.09868959868959869, 'fraction_numerical': 0.005187005187005187, 'mean_word_length': 5.728191000918273, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3252142', 'n_tokens_mistral': 2875, 'n_tokens_neox': 2652, 'n_words': 532}