diff options
| author | Přemysl Eric Janouch <p@janouch.name> | 2022-08-23 22:32:45 +0200 | 
|---|---|---|
| committer | Přemysl Eric Janouch <p@janouch.name> | 2022-08-23 22:32:45 +0200 | 
| commit | 92c1bf783f699067b507e56a15977292a319c492 (patch) | |
| tree | 3197d25be5c7f8eaa758a903caf7301138ee214a | |
| parent | 435485d145ea0aac1761aa99861067eb9de6ff25 (diff) | |
| download | nncmpp-92c1bf783f699067b507e56a15977292a319c492.tar.gz nncmpp-92c1bf783f699067b507e56a15977292a319c492.tar.xz nncmpp-92c1bf783f699067b507e56a15977292a319c492.zip | |
Build with AsciiDoc as well as Asciidoctor
| -rw-r--r-- | CMakeLists.txt | 29 | ||||
| -rw-r--r-- | README.adoc | 2 | 
2 files changed, 21 insertions, 10 deletions
| diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a685c0..5677dcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,20 +128,31 @@ install (DIRECTORY contrib DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})  # Generate documentation from text markup  find_program (ASCIIDOCTOR_EXECUTABLE asciidoctor) -if (NOT ASCIIDOCTOR_EXECUTABLE) -	message (FATAL_ERROR "asciidoctor not found") +find_program (A2X_EXECUTABLE a2x) +if (NOT ASCIIDOCTOR_EXECUTABLE AND NOT A2X_EXECUTABLE) +	message (FATAL_ERROR "Neither asciidoctor nor a2x were found")  endif ()  foreach (page ${PROJECT_NAME})  	set (page_output "${PROJECT_BINARY_DIR}/${page}.1")  	list (APPEND project_MAN_PAGES "${page_output}") -	add_custom_command (OUTPUT ${page_output} -		COMMAND ${ASCIIDOCTOR_EXECUTABLE} -b manpage -			-a release-version=${PROJECT_VERSION} -			"${PROJECT_SOURCE_DIR}/${page}.adoc" -			-o "${page_output}" -		DEPENDS ${page}.adoc -		COMMENT "Generating man page for ${page}" VERBATIM) +	if (ASCIIDOCTOR_EXECUTABLE) +		add_custom_command (OUTPUT ${page_output} +			COMMAND ${ASCIIDOCTOR_EXECUTABLE} -b manpage +				-a release-version=${PROJECT_VERSION} +				-o "${page_output}" +				"${PROJECT_SOURCE_DIR}/${page}.adoc" +			DEPENDS ${page}.adoc +			COMMENT "Generating man page for ${page}" VERBATIM) +	elseif (A2X_EXECUTABLE) +		add_custom_command (OUTPUT ${page_output} +			COMMAND ${A2X_EXECUTABLE} --doctype manpage --format manpage +				-a release-version=${PROJECT_VERSION} +				-D "${PROJECT_BINARY_DIR}" +				"${PROJECT_SOURCE_DIR}/${page}.adoc" +			DEPENDS ${page}.adoc +			COMMENT "Generating man page for ${page}" VERBATIM) +	endif ()  endforeach ()  add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES}) diff --git a/README.adoc b/README.adoc index 204316f..d634d57 100644 --- a/README.adoc +++ b/README.adoc @@ -37,7 +37,7 @@ The rest of this README will concern itself with externalities.  Building  -------- -Build dependencies: CMake, pkg-config, asciidoctor, +Build dependencies: CMake, pkg-config, asciidoctor or asciidoc,                      liberty (included), termo (included) +  Runtime dependencies: ncursesw, libunistring, cURL +  Optional runtime dependencies: fftw3, libpulse, x11, xft | 
