<commit_before>add_custom_target(External)

add_subdirectory(external/Faddeeva)
include_directories(${CMAKE_SOURCE_DIR}/external/Faddeeva)
set(FADDEEVA_LIBRARY ${CMAKE_BINARY_DIR}/external/Faddeeva/libFaddeeva${CMAKE_STATIC_LIBRARY_SUFFIX})

set(EXTERNAL_SOURCE_DIR ${PROJECT_SOURCE_DIR}/external)
set(EXTERNAL_BUILD_DIR ${PROJECT_BINARY_DIR}/external/build)

#
# add pugixml
#
find_library(PUGIXML_LIBRARY pugixml
					HINTS "/usr/local" "/usr/local/lib" "/usr/lib")
find_path(PUGIXML_INCLUDE_DIR pugixml.hpp
					HINTS "/usr/local/include" "/usr/include")

if((NOT PUGIXML_LIBRARY) OR (NOT PUGIXML_INCLUDE_DIR))
	message("Unable to find pugixml, cloning...")
	
	ExternalProject_Add(pugixml_external
			PREFIX ${EXTERNAL_BUILD_DIR}/pugixml
			GIT_REPOSITORY https://github.com/zeux/pugixml
			UPDATE_COMMAND ""
			)
									       
	set(PUGIXML_LIBRARY ${EXTERNAL_BUILD_DIR}/pugixml/src/pugixml_external-build/libpugixml${CMAKE_STATIC_LIBRARY_SUFFIX})
	set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml/src/pugixml_external/include)
	
	add_library(libpugixml STATIC IMPORTED)
	set_target_properties(libpugixml PROPERTIES IMPORTED_LOCATION ${PUGIXML_LIBRARY})
									       
else()
	message("Found pugixml")
	
	add_library(libpugixml INTERFACE)
	target_include_directories(libpugixml INTERFACE ${PUGIXML_INCLUDE_DIR})
	target_link_libraries(libpugixml INTERFACE ${PUGIXML_LIBRARY})
endif()


#
# add google test

find_library(GTEST_LIBRARY gtest<commit_msg>why do external libraries never work<commit_after>add_custom_target(External)

add_subdirectory(external/Faddeeva)
include_directories(${CMAKE_SOURCE_DIR}/external/Faddeeva)
set(FADDEEVA_LIBRARY ${CMAKE_BINARY_DIR}/external/Faddeeva/libFaddeeva${CMAKE_STATIC_LIBRARY_SUFFIX})

set(EXTERNAL_SOURCE_DIR ${PROJECT_SOURCE_DIR}/external)
set(EXTERNAL_BUILD_DIR ${PROJECT_BINARY_DIR}/external/build)

#
# add pugixml
#
find_library(PUGIXML_LIBRARY pugixml
					HINTS "/usr/local" "/usr/local/lib" "/usr/lib")
find_path(PUGIXML_INCLUDE_DIR pugixml.hpp
					HINTS "/usr/local/include" "/usr/include")

if((NOT PUGIXML_LIBRARY) OR (NOT PUGIXML_INCLUDE_DIR))
	message("Unable to find pugixml, cloning...")
	
	ExternalProject_Add(pugixml_external
			PREFIX ${EXTERNAL_BUILD_DIR}/pugixml
			GIT_REPOSITORY https://github.com/zeux/pugixml
			CMAKE_ARGS “-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>”
			UPDATE_COMMAND ""
			BUILD_COMMAND "make pugixml"
			INSTALL_COMMAND ""
			)
									       
	set(PUGIXML_LIBRARY ${EXTERNAL_BUILD_DIR}/pugixml/src/pugixml_external-build/libpugixml${CMAKE_STATIC_LIBRARY_SUFFIX})
	set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/pugixml/src/pugixml_external/include)
	
	add_library(libpugixml STATIC IMPORTED)
	set_target_properties(libpugixml PROPERTIES IMPORTED_LOCATION ${PUGIXML_LIBRARY})
									       
else()
	message("Found pugixml")
	
	add_library(libpugixml INTERFACE)
	target_include_directories(libpugixml INTERFACE ${PUGIXML_INCLUDE_DIR})
	target_link_libraries(libpugixml INTERFACE ${PUGIXML_LIBRARY})
endif()


#
# add google test

find_library(GTEST_LIBRARY gtest
{'fraction_non_alphanumeric': 0.1003257328990228, 'fraction_numerical': 0.0, 'mean_word_length': 6.582716049382716, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 37}, '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': '7113914', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1194, 'n_words': 142}