<commit_before>project(boundingmesh-lib)

find_package(Eigen 3 REQUIRED)
find_package(Coin)
#find_package(GMP REQUIRED)
#find_package(CGAL)
#set(QHULL_USE_STATIC True)
find_package(QHULL)

#${CGAL_INCLUDE_DIRS} ${GMP_INCLUDE_DIRS}
set(BOUNDINGMESH_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})

if(COIN_FOUND)
	add_definitions(-DCOIN_AVAILABLE -DCOIN_NOT_DLL)
	set(BOUNDINGMESH_INCLUDE_DIRS ${BOUNDINGMESH_INCLUDE_DIRS} ${COIN_INCLUDE_DIRS})
endif(COIN_FOUND)

if(QHULL_FOUND)
	add_definitions(-DQHULL_AVAILABLE)
	set(BOUNDINGMESH_INCLUDE_DIRS ${BOUNDINGMESH_INCLUDE_DIRS} ${QHULL_INCLUDE_DIRS})
else(QHULL_FOUND)
	message("Not building boundingmesh-convexhull, would need QHULL library.")
endif(QHULL_FOUND)

set(BOUNDINGMESH_INCLUDE_DIRS ${BOUNDINGMESH_INCLUDE_DIRS} PARENT_SCOPE)

include_directories(
	${BOUNDINGMESH_INCLUDE_DIRS}
)

add_library(
	boundingmesh
	STATIC
	Primitives.cpp
	Mesh.cpp
	Decimator.cpp
	MetricGenerator.cpp
	ContractionUtils.cpp
)

set(
	HDRS
	boundingmesh.h
	Primitives.h
	Mesh.h
	Decimator.h
	MetricGenerator.h
	ContractionUtils.h
)

set(BOUNDINGMESH_LIBRARIES boundingmesh)

if(COIN_FOUND)
	set(BOUNDINGMESH_LIBRARIES ${BOUNDINGMESH_LIBRARIES} ${COIN_LIBRARIES})
endif(COIN_FOUND)

if(QHULL_FOUND)
	set(BOUNDINGMESH_LIBRARIES ${BOUNDINGMESH_LIBRARIES} ${QHULL_LIBRARIES})
endif(QHULL_FOUND)


set(BOUNDINGMESH_LIBRARIES ${BOUNDINGMESH_LIBRARIES} PARENT_SCOPE)

set_target_properties(
	boundingmesh
	PROPERTIES
	VERSION ${VERSION}
)

target_link_libraries(boundingmesh ${BOUNDINGMESH_LIBRARIES})

install(
	FILES ${HDRS} 
	DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
	TARGETS boundingmesh
	EXPORT boundingmesh-export
	ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
	RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

include(CMakePackageConfigHelpers)
configure_package_config_file(
	boundingmesh-config.cmake.in
	boundingmesh-config.cmake
	INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}
)<commit_msg>do not link library itself<commit_after>project(boundingmesh-lib)

find_package(Eigen 3 REQUIRED)
find_package(Coin)
#find_package(GMP REQUIRED)
#find_package(CGAL)
#set(QHULL_USE_STATIC True)
find_package(QHULL)

#${CGAL_INCLUDE_DIRS} ${GMP_INCLUDE_DIRS}
set(BOUNDINGMESH_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})

if(COIN_FOUND)
	add_definitions(-DCOIN_AVAILABLE -DCOIN_NOT_DLL)
	set(BOUNDINGMESH_INCLUDE_DIRS ${BOUNDINGMESH_INCLUDE_DIRS} ${COIN_INCLUDE_DIRS})
endif(COIN_FOUND)

if(QHULL_FOUND)
	add_definitions(-DQHULL_AVAILABLE)
	set(BOUNDINGMESH_INCLUDE_DIRS ${BOUNDINGMESH_INCLUDE_DIRS} ${QHULL_INCLUDE_DIRS})
else(QHULL_FOUND)
	message("Not building boundingmesh-convexhull, would need QHULL library.")
endif(QHULL_FOUND)

set(BOUNDINGMESH_INCLUDE_DIRS ${BOUNDINGMESH_INCLUDE_DIRS} PARENT_SCOPE)

include_directories(
	${BOUNDINGMESH_INCLUDE_DIRS}
)

add_library(
	boundingmesh
	STATIC
	Primitives.cpp
	Mesh.cpp
	Decimator.cpp
	MetricGenerator.cpp
	ContractionUtils.cpp
)

set(
	HDRS
	boundingmesh.h
	Primitives.h
	Mesh.h
	Decimator.h
	MetricGenerator.h
	ContractionUtils.h
)

set(BOUNDINGMESH_LIBRARIES boundingmesh)

if(COIN_FOUND)
	set(BOUNDINGMESH_LIBRARIES ${BOUNDINGMESH_LIBRARIES} ${COIN_LIBRARIES})
endif(COIN_FOUND)

if(QHULL_FOUND)
	set(BOUNDINGMESH_LIBRARIES ${BOUNDINGMESH_LIBRARIES} ${QHULL_LIBRARIES})
endif(QHULL_FOUND)


set(BOUNDINGMESH_LIBRARIES ${BOUNDINGMESH_LIBRARIES} PARENT_SCOPE)

set_target_properties(
	boundingmesh
	PROPERTIES
	VERSION ${VERSION}
)

install(
	FILES ${HDRS} 
	DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
	TARGETS boundingmesh
	EXPORT boundingmesh-export
	ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
	RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

include(CMakePackageConfigHelpers)
configure_package_config_file(
	boundingmesh-config.cmake.in
	boundingmesh-config.cmake
	INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
{'fraction_non_alphanumeric': 0.0869453044375645, 'fraction_numerical': 0.0005159958720330237, 'mean_word_length': 9.366310160427808, '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': '7565990', 'n_tokens_mistral': 1755, 'n_tokens_neox': 1606, 'n_words': 210}