Add CMake configuration for building specification PDF

This commit is contained in:
2025-10-10 22:23:56 +01:00
parent c4564b3a0a
commit 421506c9fc
2 changed files with 42 additions and 1 deletions

View File

@@ -221,4 +221,5 @@ endif()
target_link_libraries(aaruformat slog)
add_subdirectory(tests)
add_subdirectory(tool)
add_subdirectory(tool)
add_subdirectory(docs/spec)

40
docs/spec/CMakeLists.txt Normal file
View File

@@ -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 <http://www.gnu.org/licenses/>.
# 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()