summaryrefslogtreecommitdiff
path: root/docs/man
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2022-11-03 13:16:40 +0200
committerPanu Matilainen <pmatilai@redhat.com>2022-11-03 13:26:35 +0200
commit89953f647a4b85143e7a7b78ac0122580998ebd6 (patch)
tree57b1d3cc04f5f08a0017a1e7a629675b4679904c /docs/man
parentd1e234bd567300b80172d8e1cdba9c6759b3eeb2 (diff)
downloadrpm-89953f647a4b85143e7a7b78ac0122580998ebd6.tar.gz
Fix some cmake newbie variable testing confusion
Where pkg_check_modules(FOO foo) sets FOO_FOUND if found, find_package() is similar but the module names are randomly miXedCase and so you get miXedCase_FOUND, if you're lucky. Now, find_program(FOO foo) though, that's entirely different. It always defines FOO, regardless of whether it found something, and no other variables. And worse, it's defined to FOO-NOTFOUND, so you can't use the obvious if() shortcuts there. A simple way around this is testing for program existence - a trick lifted from libdnf, cheers if you're reading. Newbie errors and all, but one may have expected a bit more consistency from this much touted cmake thing...
Diffstat (limited to 'docs/man')
-rw-r--r--docs/man/CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/man/CMakeLists.txt b/docs/man/CMakeLists.txt
index 41903153f..a5aa1608f 100644
--- a/docs/man/CMakeLists.txt
+++ b/docs/man/CMakeLists.txt
@@ -32,7 +32,7 @@ endif()
foreach(man ${manuals})
# XXX manuals should be pre-built in tarballs
- if (DEFINED PANDOC)
+ if (EXISTS ${PANDOC})
add_custom_command(OUTPUT ${man} COMMAND ${PANDOC}
${CMAKE_CURRENT_SOURCE_DIR}/${man}.md -o ${man}
DEPENDS ${man}.md)