summaryrefslogtreecommitdiffstats
path: root/Utilities/Sphinx/CMakeLists.txt
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-31 13:44:27 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-03-31 21:55:08 (GMT)
commit85582d14fe19ba3d66c49ec95286bcaf7c675ca4 (patch)
treeb6abe26c48b8699677b94108843048d4de118be9 /Utilities/Sphinx/CMakeLists.txt
parent521b930bf4e211735842e71f1eb0018c2184a05f (diff)
downloadCMake-85582d14fe19ba3d66c49ec95286bcaf7c675ca4.zip
CMake-85582d14fe19ba3d66c49ec95286bcaf7c675ca4.tar.gz
CMake-85582d14fe19ba3d66c49ec95286bcaf7c675ca4.tar.bz2
Help: Add option to create and install Qt .qch file.
Diffstat (limited to 'Utilities/Sphinx/CMakeLists.txt')
-rw-r--r--Utilities/Sphinx/CMakeLists.txt24
1 files changed, 23 insertions, 1 deletions
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index 23dc6ae..51c83ba 100644
--- a/Utilities/Sphinx/CMakeLists.txt
+++ b/Utilities/Sphinx/CMakeLists.txt
@@ -24,6 +24,7 @@ project(CMakeHelp NONE)
option(SPHINX_MAN "Build man pages with Sphinx" OFF)
option(SPHINX_HTML "Build html help with Sphinx" OFF)
+option(SPHINX_QTHELP "Build Qt help with Sphinx" OFF)
option(SPHINX_TEXT "Build text help with Sphinx (not installed)" OFF)
find_program(SPHINX_EXECUTABLE
NAMES sphinx-build
@@ -32,7 +33,7 @@ find_program(SPHINX_EXECUTABLE
mark_as_advanced(SPHINX_TEXT)
-if(NOT SPHINX_MAN AND NOT SPHINX_HTML AND NOT SPHINX_TEXT)
+if(NOT SPHINX_MAN AND NOT SPHINX_HTML AND NOT SPHINX_QTHELP AND NOT SPHINX_TEXT)
return()
elseif(NOT SPHINX_EXECUTABLE)
message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!")
@@ -63,6 +64,21 @@ endif()
if(SPHINX_TEXT)
list(APPEND doc_formats text)
endif()
+if(SPHINX_QTHELP)
+ find_program(QCOLLECTIONGENERATOR_EXECUTABLE
+ NAMES qcollectiongenerator
+ DOC "qcollectiongenerator tool"
+ )
+ if (NOT QCOLLECTIONGENERATOR_EXECUTABLE)
+ message(FATAL_ERROR "QCOLLECTIONGENERATOR_EXECUTABLE (qcollectiongenerator) not found!")
+ endif()
+ list(APPEND doc_formats qthelp)
+
+ set(qthelp_extra_commands
+ COMMAND qcollectiongenerator ${CMAKE_CURRENT_BINARY_DIR}/qthelp/CMake.qhcp
+ )
+endif()
+
set(doc_format_outputs "")
set(doc_format_last "")
@@ -78,6 +94,7 @@ foreach(format ${doc_formats})
${CMake_SOURCE_DIR}/Help
${CMAKE_CURRENT_BINARY_DIR}/${format}
> ${doc_format_log} # log stdout, pass stderr
+ ${${format}_extra_commands}
DEPENDS ${doc_format_last}
COMMENT "sphinx-build ${format}: see Utilities/Sphinx/${doc_format_log}"
VERBATIM
@@ -122,3 +139,8 @@ if(SPHINX_HTML)
PATTERN objects.inv EXCLUDE
)
endif()
+if(SPHINX_QTHELP)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qthelp/CMake.qch
+ DESTINATION ${CMAKE_DOC_DIR}
+ )
+endif()