<commit_before>
# https://cmake.org/cmake/help/latest/command/find_package.html

function(install_targets targets namespace )

set( INSTALL_DIR_CMAKE share/MartCommon )
set( CONFIG_STEM_NAME MartCommonConfig )

install( TARGETS ${targets} EXPORT ${CONFIG_STEM_NAME} )
install( EXPORT ${CONFIG_STEM_NAME}
	FILE
		${CONFIG_STEM_NAME}.cmake
	NAMESPACE
		${namespace}
	DESTINATION
		${INSTALL_DIR_CMAKE}
)
install( DIRECTORY include/ DESTINATION include )

include(CMakePackageConfigHelpers)

write_basic_package_version_file("${CONFIG_STEM_NAME}Version.cmake"
	VERSION ${${PROJECT_NAME}_VERSION}
	COMPATIBILITY SameMajorVersion
)

install(
	FILES
		"${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_STEM_NAME}Version.cmake"
	DESTINATION
		${INSTALL_DIR_CMAKE}
)

install(
	FILES
		"LICENSE.md"
	DESTINATION
		share<commit_msg>[CMake] Fix install_targets function to accept non-header only libraries too<commit_after>
# https://cmake.org/cmake/help/latest/command/find_package.html

function(install_targets targets namespace )

set( INSTALL_DIR_CMAKE share/MartCommon )
set( CONFIG_STEM_NAME MartCommonConfig )

include(GNUInstallDirs)

# install results from compiling the targets and export the
# relevant information into file
install( TARGETS ${targets} EXPORT ${CONFIG_STEM_NAME}
	RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
	ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

# install the CmakeConfig file holding the infromation about the isntalled targets
install( EXPORT ${CONFIG_STEM_NAME}
	FILE
		${CONFIG_STEM_NAME}.cmake
	NAMESPACE
		${namespace}
	DESTINATION
		${INSTALL_DIR_CMAKE}
)
install( DIRECTORY include/ DESTINATION include )

include(CMakePackageConfigHelpers)

write_basic_package_version_file("${CONFIG_STEM_NAME}Version.cmake"
	VERSION ${${PROJECT_NAME}_VERSION}
	COMPATIBILITY SameMajorVersion
)

install(
	FILES
		"${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_STEM_NAME}Version.cmake"
	DESTINATION
		${INSTALL_DIR_CMAKE}
)

install(
	FILES
		"LICENSE.md"
	DESTINATION
		share
{'fraction_non_alphanumeric': 0.08951533135509397, 'fraction_numerical': 0.0, 'mean_word_length': 6.996047430830039, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5802107', 'n_tokens_mistral': 733, 'n_tokens_neox': 690, 'n_words': 134}