From b4eef59100442c292fbc54af4e07197bd367cff0 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 30 Jan 2015 12:53:52 -0800 Subject: [PATCH] Only add the doc target if doxygen and sphinx-build are available --- doc/CMakeLists.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 7b531f65..0dda20fe 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,4 +1,11 @@ +foreach (program doxygen sphinx-build) + find_program(${program} ${program}) + if (NOT ${program}) + message(STATUS "Target 'doc' disabled (requires ${program})") + return () + endif () +endforeach () + add_custom_target(doc - COMMAND doxygen - COMMAND rm -rf html - COMMAND sphinx-build -b html . html) + COMMAND ${doxygen} + COMMAND ${sphinx-build} -b html . html)