diff options
author | Brad King <brad.king@kitware.com> | 2014-01-28 15:41:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-01-29 15:10:15 (GMT) |
commit | ef7a1b41445f11bd05331a2a1d9d7fb44c1aa7d8 (patch) | |
tree | 32e36d63f20152f66eea84a8d6c805081fa5e593 /Utilities/CMakeLists.txt | |
parent | 174314e08a73011fe0115dde9932bc8e2fd6ebc9 (diff) | |
download | CMake-ef7a1b41445f11bd05331a2a1d9d7fb44c1aa7d8.zip CMake-ef7a1b41445f11bd05331a2a1d9d7fb44c1aa7d8.tar.gz CMake-ef7a1b41445f11bd05331a2a1d9d7fb44c1aa7d8.tar.bz2 |
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.txt | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index 410f37a..8b3e325 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() |