summaryrefslogtreecommitdiffstats
path: root/Utilities/Release/create-cmake-release.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-01-28 15:41:56 (GMT)
committerBrad King <brad.king@kitware.com>2014-01-29 15:10:15 (GMT)
commitef7a1b41445f11bd05331a2a1d9d7fb44c1aa7d8 (patch)
tree32e36d63f20152f66eea84a8d6c805081fa5e593 /Utilities/Release/create-cmake-release.cmake
parent174314e08a73011fe0115dde9932bc8e2fd6ebc9 (diff)
downloadCMake-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/Release/create-cmake-release.cmake')
-rw-r--r--Utilities/Release/create-cmake-release.cmake42
1 files changed, 40 insertions, 2 deletions
diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake
index f4789a7..95428b6 100644
--- a/Utilities/Release/create-cmake-release.cmake
+++ b/Utilities/Release/create-cmake-release.cmake
@@ -28,7 +28,7 @@ function(write_batch_shell_script filename)
math(EXPR y "160*(${i}%4)")
file(APPEND ${filename}
"
-\"${CMAKE_COMMAND}\" -DCMAKE_CREATE_VERSION=${CMAKE_CREATE_VERSION} -P \"${CMAKE_ROOT}/Utilities/Release/${f}\" < /dev/null >& \"${CMAKE_CURRENT_SOURCE_DIR}/logs/${f}-${CMAKE_CREATE_VERSION}.log\" &
+\"${CMAKE_COMMAND}\" -DCMAKE_CREATE_VERSION=${CMAKE_CREATE_VERSION} -DCMAKE_DOC_TARBALL=\"${CMAKE_DOC_TARBALL}\" -P \"${CMAKE_ROOT}/Utilities/Release/${f}\" < /dev/null >& \"${CMAKE_CURRENT_SOURCE_DIR}/logs/${f}-${CMAKE_CREATE_VERSION}.log\" &
xterm -geometry 64x6+${x}+${y} -sb -sl 2000 -T ${f}-${CMAKE_CREATE_VERSION}.log -e tail -f \"${CMAKE_CURRENT_SOURCE_DIR}/logs/${f}-${CMAKE_CREATE_VERSION}.log\" &
")
math(EXPR i "${i}+1")
@@ -36,7 +36,45 @@ xterm -geometry 64x6+${x}+${y} -sb -sl 2000 -T ${f}-${CMAKE_CREATE_VERSION}.log
execute_process(COMMAND chmod a+x ${filename})
endfunction()
+function(write_docs_shell_script filename)
+ find_program(SPHINX_EXECUTABLE
+ NAMES sphinx-build sphinx-build.py
+ DOC "Sphinx Documentation Builder (sphinx-doc.org)"
+ )
+ if(NOT SPHINX_EXECUTABLE)
+ message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!")
+ endif()
+
+ set(name cmake-${CMAKE_CREATE_VERSION}-docs)
+ file(WRITE "${filename}" "#!/usr/bin/env bash
+
+name=${name} &&
+inst=\"\$PWD/\$name\"
+(GIT_WORK_TREE=x git archive --prefix=\${name}-src/ ${CMAKE_CREATE_VERSION}) | tar x &&
+rm -rf \${name}-build &&
+mkdir \${name}-build &&
+cd \${name}-build &&
+\"${CMAKE_COMMAND}\" ../\${name}-src/Utilities/Sphinx \\
+ -DCMAKE_INSTALL_PREFIX=\"\$inst/\" \\
+ -DSPHINX_EXECUTABLE=\"${SPHINX_EXECUTABLE}\" \\
+ -DSPHINX_HTML=ON -DSPHINX_MAN=ON &&
+make install &&
+cd .. &&
+tar czf \${name}.tar.gz \${name} ||
+echo 'Failed to create \${name}.tar.gz'
+")
+ execute_process(COMMAND chmod a+x ${filename})
+ set(CMAKE_DOC_TARBALL "${name}.tar.gz" PARENT_SCOPE)
+endfunction()
+
+write_docs_shell_script("create-${CMAKE_CREATE_VERSION}-docs.sh")
write_batch_shell_script("create-${CMAKE_CREATE_VERSION}-batch1.sh" ${RELEASE_SCRIPTS_BATCH_1})
+unset(CMAKE_DOC_TARBALL) # No pre-built docs in second batch.
write_batch_shell_script("create-${CMAKE_CREATE_VERSION}-batch2.sh" ${RELEASE_SCRIPTS_BATCH_2})
-message("Run ./create-${CMAKE_CREATE_VERSION}-batch1.sh, then after all those builds complete, run ./create-${CMAKE_CREATE_VERSION}-batch2.sh")
+message("Run one at a time:
+ ./create-${CMAKE_CREATE_VERSION}-docs.sh &&
+ ./create-${CMAKE_CREATE_VERSION}-batch1.sh &&
+ ./create-${CMAKE_CREATE_VERSION}-batch2.sh &&
+ echo done
+")