summaryrefslogtreecommitdiff
path: root/Utilities/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-01-28 10:41:56 -0500
committerBrad King <brad.king@kitware.com>2014-01-29 10:10:15 -0500
commitef7a1b41445f11bd05331a2a1d9d7fb44c1aa7d8 (patch)
tree32e36d63f20152f66eea84a8d6c805081fa5e593 /Utilities/CMakeLists.txt
parent174314e08a73011fe0115dde9932bc8e2fd6ebc9 (diff)
downloadcmake-ef7a1b41445f11bd05331a2a1d9d7fb44c1aa7d8.tar.gz
Utilities/Release: Pass pre-built docs tarball
Avoid requiring all build machines for the upstream packaging process to have Python and Sphinx installed. Instead create a way to build the documentation once on the host machine and copy it to each build machine as a tarball with content to include in the installation tree for packaging.
Diffstat (limited to 'Utilities/CMakeLists.txt')
-rw-r--r--Utilities/CMakeLists.txt23
1 files changed, 22 insertions, 1 deletions
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index 410f37a23b..8b3e325fa0 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -11,4 +11,25 @@
#=============================================================================
subdirs(Doxygen KWStyle)
-add_subdirectory(Sphinx)
+if(CMAKE_DOC_TARBALL)
+ # Undocumented option to extract and install pre-built documentation.
+ # This is intended for use during packaging of CMake itself.
+ if(CMAKE_DOC_TARBALL MATCHES "/([^/]+)\\.tar\\.gz$")
+ set(dir "${CMAKE_MATCH_1}")
+ else()
+ message(FATAL_ERROR "CMAKE_DOC_TARBALL must end in .tar.gz")
+ endif()
+ add_custom_command(
+ OUTPUT ${dir}.stamp
+ COMMAND cmake -E remove_directory ${dir}
+ COMMAND cmake -E tar xf ${CMAKE_DOC_TARBALL}
+ COMMAND cmake -E touch ${dir}.stamp
+ DEPENDS ${CMAKE_DOC_TARBALL}
+ )
+ add_custom_target(documentation ALL DEPENDS ${dir}.stamp)
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}/
+ DESTINATION . USE_SOURCE_PERMISSIONS)
+else()
+ # Normal documentation build.
+ add_subdirectory(Sphinx)
+endif()