<commit_before>FILE( GLOB ontologies RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.ont )

set( ontology_dotfiles )

message( "${ontologies}" )

foreach( ontology ${ontologies} )
	get_filename_component( ontology_name ${ontology} NAME_WE )
	message( "${ontology} -> ${ontology_name}.dot" )

	add_custom_command(
		OUTPUT ${ontology_name}.dot
		COMMAND ${EXECUTABLE_OUTPUT_PATH}/ont2dot "${ontology}"
		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
		COMMENT "Generating graphviz for ${ontology}"
		DEPENDS ont2dot )

	list( APPEND ontology_dotfiles ${ontology_name}.dot )
endforeach()

message( "${ontology_dotfiles}" )
add_custom_target( ontology_graphviz ALL DEPENDS ${ontology_dotfiles} )<commit_msg>build: Updated rule to generate dot files from ontology files; added rule to generate PDFs from dot files<commit_after>FILE( GLOB ontologies RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.ont )

set( ontology_dotfiles )
set( ontology_pdfs )

message( "${ontologies}" )

find_program( dot_executable_location "dot" )

foreach( ontology ${ontologies} )
	get_filename_component( ontology_name ${ontology} NAME_WE )
	message( "${ontology} -> ${ontology_name}.dot" )

	file( RELATIVE_PATH ontology_relpath ${PROJECT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/${ontology_name}" )
	file( RELATIVE_PATH dotfile_relpath ${PROJECT_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/${ontology_name}" )

	add_custom_command(
		OUTPUT "${ontology_name}.dot"
		COMMAND ${EXECUTABLE_OUTPUT_PATH}/ont2dot < "${ontology_relpath}.ont" > "${dotfile_relpath}.dot"
		WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
		COMMENT "Generating graphviz for ${ontology}"
		DEPENDS ont2dot )
	list( APPEND ontology_dotfiles "${ontology_name}.dot" )

	add_custom_command(
		OUTPUT "${ontology_name}.pdf"
		COMMAND ${dot_executable_location} -Tpdf "${dotfile_relpath}.dot" -o "${dotfile_relpath}.pdf"
		WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
		COMMENT "Generating graphviz for ${ontology}"
		DEPENDS "${ontology_name}.dot" )
	list( APPEND ontology_pdfs "${ontology_name}.pdf" )

endforeach()

message( "${ontology_dotfiles}" )
message( "${ontology_pdfs}" )
add_custom_target( ontology_graphviz ALL DEPENDS ${ontology_dotfiles} )
add_custom_target( ontology_pdfs DEPENDS ${ontology_pdfs} )
{'fraction_non_alphanumeric': 0.1249438202247191, 'fraction_numerical': 0.0017977528089887641, 'mean_word_length': 7.368421052631579, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '6573845', 'n_tokens_mistral': 802, 'n_tokens_neox': 758, 'n_words': 155}