aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindAsciidoctor.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules/FindAsciidoctor.cmake')
-rw-r--r--cmake/modules/FindAsciidoctor.cmake33
1 files changed, 19 insertions, 14 deletions
diff --git a/cmake/modules/FindAsciidoctor.cmake b/cmake/modules/FindAsciidoctor.cmake
index 69150a1f32..fd9db9da11 100644
--- a/cmake/modules/FindAsciidoctor.cmake
+++ b/cmake/modules/FindAsciidoctor.cmake
@@ -8,7 +8,11 @@ INCLUDE(FindChocolatey)
FIND_PROGRAM(ASCIIDOCTOR_EXECUTABLE
NAMES
+ asciidoctorj.cmd
+ asciidoctorj.bat
asciidoctorj
+ asciidoctor.cmd
+ asciidoctor.bat
asciidoctor
asciidoctor.ruby2.1
# XXX Add Asciidoctor.js releases (asciidoctor-linux,
@@ -31,22 +35,17 @@ if(ASCIIDOCTOR_EXECUTABLE)
function(set_asciidoctor_target_properties _target)
set_target_properties(${_target} PROPERTIES
- FOLDER "Docbook"
+ FOLDER "Documentation"
EXCLUDE_FROM_DEFAULT_BUILD True
)
endfunction(set_asciidoctor_target_properties)
- function(set_manpage_target_properties _target)
- set_target_properties(${_target} PROPERTIES
- FOLDER "Docs"
- )
- endfunction(set_manpage_target_properties)
-
set (_asciidoctor_common_args
- # Doesn't work with AsciidoctorJ?
+ # AsciidoctorJ added --failure-level in version 2.5.6
# --failure-level=WARN
# --trace
- --attribute build_dir=${CMAKE_CURRENT_BINARY_DIR}
+ --quiet
+ --attribute build_dir=${CMAKE_BINARY_DIR}/docbook
--require ${CMAKE_SOURCE_DIR}/docbook/asciidoctor-macros/ws_utils.rb
--require ${CMAKE_SOURCE_DIR}/docbook/asciidoctor-macros/commaize-block.rb
--require ${CMAKE_SOURCE_DIR}/docbook/asciidoctor-macros/cveidlink-inline-macro.rb
@@ -79,6 +78,7 @@ if(ASCIIDOCTOR_EXECUTABLE)
--out-file ${_output_xml}
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
DEPENDS
+ ${CMAKE_SOURCE_DIR}/doc/attributes.adoc
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
${ARGN}
)
@@ -110,6 +110,7 @@ if(ASCIIDOCTOR_EXECUTABLE)
--out-file ${_output_html}
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
DEPENDS
+ ${CMAKE_SOURCE_DIR}/doc/attributes.adoc
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
${ARGN}
)
@@ -126,10 +127,12 @@ if(ASCIIDOCTOR_EXECUTABLE)
ADD_CUSTOM_COMMAND(
OUTPUT
${_output_txt}
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/html2text.py
+ COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/html2text.py
${_output_html}
> ${_output_txt}
DEPENDS
+ ${MAN_INCLUDES}
+ ${CMAKE_SOURCE_DIR}/doc/attributes.adoc
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
${_output_html}
${ARGN}
@@ -156,10 +159,10 @@ if(ASCIIDOCTOR_EXECUTABLE)
--destination-dir ${CMAKE_CURRENT_BINARY_DIR}
${_input_adoc}
DEPENDS
+ ${MAN_INCLUDES}
+ ${CMAKE_SOURCE_DIR}/doc/attributes.adoc
${_input_adoc}
)
- add_custom_target(generate_roff_man${_man_section}_pages DEPENDS ${_output_man})
- set_manpage_target_properties(generate_roff_man${_man_section}_pages)
unset(_src_file)
unset(_input_adoc)
unset(_output_man)
@@ -183,10 +186,10 @@ if(ASCIIDOCTOR_EXECUTABLE)
--destination-dir ${CMAKE_CURRENT_BINARY_DIR}
${_input_adoc}
DEPENDS
+ ${MAN_INCLUDES}
+ ${CMAKE_SOURCE_DIR}/doc/attributes.adoc
${_input_adoc}
)
- add_custom_target(generate_html_man_pages DEPENDS ${_output_man})
- set_manpage_target_properties(generate_html_man_pages)
unset(_src_file)
unset(_input_adoc)
unset(_output_man)
@@ -229,6 +232,7 @@ if(ASCIIDOCTOR_EXECUTABLE)
--out-file "${_output_pdf}"
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
DEPENDS
+ ${CMAKE_SOURCE_DIR}/doc/attributes.adoc
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
${ARGN}
VERBATIM
@@ -279,6 +283,7 @@ if(ASCIIDOCTOR_EXECUTABLE)
--out-file "${_output_epub}"
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
DEPENDS
+ ${CMAKE_SOURCE_DIR}/doc/attributes.adoc
${CMAKE_CURRENT_SOURCE_DIR}/${_asciidocsource}
${ARGN}
VERBATIM