diff --git a/CMakeLists.txt b/CMakeLists.txt index 122cc49..2da6ab8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,4 +221,5 @@ endif() target_link_libraries(aaruformat slog) add_subdirectory(tests) -add_subdirectory(tool) \ No newline at end of file +add_subdirectory(tool) +add_subdirectory(docs/spec) diff --git a/docs/spec/CMakeLists.txt b/docs/spec/CMakeLists.txt new file mode 100644 index 0000000..77217b8 --- /dev/null +++ b/docs/spec/CMakeLists.txt @@ -0,0 +1,40 @@ +# This file is part of the Aaru Data Preservation Suite. +# Copyright (c) 2019-2025 Natalia Portillo. +# +# This library is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, see . + +# Find asciidoctor-pdf executable +find_program(ASCIIDOCTOR_PDF asciidoctor-pdf) + +if(ASCIIDOCTOR_PDF) + message(STATUS "Found asciidoctor-pdf: ${ASCIIDOCTOR_PDF}") + + # Add custom target to build the specification PDF + add_custom_target(spec + COMMAND ${ASCIIDOCTOR_PDF} + -a pdf-theme=theme.yml + -a "pdf-fontsdir=fonts;GEM_FONTS_DIR" + -a source-highlighter=rouge + spec.adoc + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Building AaruFormat specification PDF with asciidoctor-pdf" + VERBATIM + ) + + message(STATUS "Added 'spec' target to build the specification PDF") +else() + message(STATUS "asciidoctor-pdf not found - 'spec' target will not be available") + message(STATUS "Install it with: gem install asciidoctor-pdf") +endif() +