summaryrefslogtreecommitdiff
path: root/docs/man
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2022-10-25 13:12:32 +0300
committerPanu Matilainen <pmatilai@redhat.com>2022-10-25 13:12:32 +0300
commit6b02b68442139e2978965317b857c858497fea04 (patch)
tree12ded999232b5d84247d95222e0cb69db24d8656 /docs/man
parent1cc8ffc71f7e7297f54492cbb6d98e22816eb70a (diff)
downloadrpm-6b02b68442139e2978965317b857c858497fea04.tar.gz
Only rebuild man pages when they change
Need to use add_custom_command() to run on demand, but then that doesn't create a target that would execute so we need to add a separate "man" target that depends on the output files to trigger our new custom command. I'm sure I'll get used to this... eventually.
Diffstat (limited to 'docs/man')
-rw-r--r--docs/man/CMakeLists.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/man/CMakeLists.txt b/docs/man/CMakeLists.txt
index 0b54e64c6..41903153f 100644
--- a/docs/man/CMakeLists.txt
+++ b/docs/man/CMakeLists.txt
@@ -33,8 +33,11 @@ endif()
foreach(man ${manuals})
# XXX manuals should be pre-built in tarballs
if (DEFINED PANDOC)
- add_custom_target(${man} ALL COMMAND ${PANDOC}
- ${CMAKE_CURRENT_SOURCE_DIR}/${man}.md -o ${man})
+ add_custom_command(OUTPUT ${man} COMMAND ${PANDOC}
+ ${CMAKE_CURRENT_SOURCE_DIR}/${man}.md -o ${man}
+ DEPENDS ${man}.md)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${man} TYPE MAN)
endif()
endforeach()
+
+add_custom_target(man ALL DEPENDS ${manuals})