<commit_before>set(Boost_USE_STATIC_LIBS   ON)
set(Boost_USE_MULTITHREADED ON)
find_package( Boost 1.41.0
              REQUIRED
              COMPONENTS program_options )
find_package(Log4CXX 0.10.0 REQUIRED)

FIND_PATH(HDF5_INC_DIR
          NAMES hdf5.h
          PATHS /usr/include
                /usr/local/include
                ${swmr-testapp_SOURCE_DIR}/hdf5swmr/include)
FIND_LIBRARY(HDF5_LIBRARY
          NAMES hdf5
          PATHS 
                ${swmr-testapp_SOURCE_DIR}/hdf5swmr/lib
                ${HDF5_ROOT})

IF(NOT HDF5_INC_DIR)

   MESSAGE(FATAL_ERROR "Unable to find HDF5 SWMR install dir")

ELSE(NOT HDF5_INC_DIR)

   MESSAGE("Found HDF5 SWMR include files in: " ${HDF5_INC_DIR})

ENDIF(NOT HDF5_INC_DIR)


# Include the directory itself as a path to include directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)

#INCLUDE_DIRECTORIES(${HDF5_INC_DIR} ${log4cxx_INC_DIR})
INCLUDE_DIRECTORIES(${HDF5_INC_DIR} ${LOG4CXX_INCLUDE_DIRS}/.. ${Boost_INCLUDE_DIRS})

# Create a variable called swmr_SOURCES containing all .cpp files:
#set(swmr_SOURCES frame.cpp swmr-demo.cpp swmr-reader.cpp swmr-writer.cpp)

# For a large number of source files you can create it in a simpler way
# using file() function:
file(GLOB swmr_SOURCES *.cpp)

# Create an executable file called helloworld from sources:
add_executable(swmr ${swmr_SOURCES})
target_link_libraries(swmr z rt ${Boost_LIBRARIES} ${LOG4CXX_LIBRARIES} ${HDF5_LIBRARY})

INSTALL(TARGETS swmr
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
)<commit_msg>Proper search for dependencies<commit_after>set(Boost_USE_STATIC_LIBS   ON)
set(Boost_USE_MULTITHREADED ON)
find_package( Boost 1.41.0
              REQUIRED
              COMPONENTS program_options )

##### Find HDF5 with SWMR ###################
message("\nSearching for HDF5 with SWMR")
FIND_PATH(HDF5_INC_DIR
          NAMES hdf5.h
          PATHS /usr/include
                /usr/local/include
                ${swmr-testapp_SOURCE_DIR}/hdf5swmr/include)
FIND_LIBRARY(HDF5_LIBRARY
          NAMES hdf5
          PATHS 
                ${swmr-testapp_SOURCE_DIR}/hdf5swmr/lib
                ${HDF5_ROOT})

IF(NOT HDF5_INC_DIR)

   MESSAGE(FATAL_ERROR "Unable to find HDF5 SWMR install dir")

ELSE(NOT HDF5_INC_DIR)

   MESSAGE("Found HDF5 SWMR include files in: " ${HDF5_INC_DIR})

ENDIF(NOT HDF5_INC_DIR)
##### End of HDF5 with SWMR search ##########


##### Find other dependencies ############
find_package(Log4CXX 0.10.0 REQUIRED)
find_package(ZLIB REQUIRED)

# librt is really only required if glibc =< 2.16
FIND_LIBRARY(REALTIME_LIBRARY
             NAMES rt)
##### End of dependency search ###########


# Include the directory itself as a path to include directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)

include_directories(${HDF5_INC_DIR} ${LOG4CXX_INCLUDE_DIRS}/.. ${Boost_INCLUDE_DIRS})

# create a list of .cpp files from this directory
file(GLOB swmr_SOURCES *.cpp)

# Create an executable file called helloworld from sources:
add_executable(swmr ${swmr_SOURCES})

target_link_libraries(swmr ${ZLIB_LIBRARIES} ${Boost_LIBRARIES} ${LOG4CXX_LIBRARIES} ${HDF5_LIBRARY} ${REALTIME_LIBRARY})

INSTALL(TARGETS swmr
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
)
{'fraction_non_alphanumeric': 0.09775591761450968, 'fraction_numerical': 0.018444512757454658, 'mean_word_length': 3.8207407407407405, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3469006', 'n_tokens_mistral': 1296, 'n_tokens_neox': 1147, 'n_words': 265}