mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00

Install man pages from tar ball The generated man pages are already present in the tar ball. Simply install those then, even if Asciidoctor is not present. Optimize CMake files. Closes #620 Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
24 lines
901 B
CMake
24 lines
901 B
CMake
cmake_minimum_required (VERSION 3.10)
|
|
|
|
if (ASCIIDOCTOR_FOUND)
|
|
file (GLOB DOC_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.7.adoc")
|
|
set (DOC_FILES)
|
|
|
|
foreach (SRC IN LISTS DOC_SOURCES)
|
|
string (REPLACE ".adoc" "" OUTPUT_FILE_NAME "${SRC}")
|
|
string (REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" OUTPUT_FILE_NAME "${OUTPUT_FILE_NAME}")
|
|
|
|
add_custom_command (OUTPUT "${OUTPUT_FILE_NAME}"
|
|
COMMAND ${ASCIIDOCTOR_EXECUTABLE} -b manpage ${ASCIIDOCTOR_OPTIONS} "${SRC}" -o "${OUTPUT_FILE_NAME}"
|
|
DEPENDS "${SRC}")
|
|
|
|
list (APPEND DOC_FILES "${OUTPUT_FILE_NAME}")
|
|
endforeach (SRC)
|
|
|
|
add_custom_target (man7 DEPENDS ${DOC_FILES})
|
|
else (ASCIIDOCTOR_FOUND)
|
|
file (GLOB MAN_PAGES "${CMAKE_CURRENT_SOURCE_DIR}/*.7")
|
|
set (DOC_FILES ${MAN_PAGES})
|
|
endif (ASCIIDOCTOR_FOUND)
|
|
|
|
install (FILES ${DOC_FILES} DESTINATION ${TIMEW_MAN7DIR})
|