Sphinx and CMake, based on this example:
http://ericscottbarr.com/blog/2012/03/sphinx-and-cmake-beautiful-documentation-for-c-projects/
The 'docs/CMakeLists.txt' file was deleted in this commit: 0abfb8f46f534b05413bb4d64b960d6fd0a9befb
Thanks to Arnaud Gelas, he has passed some links:
https://github.com/InsightSoftwareConsortium/ITKExamples/blob/master/CMake/FindSphinx.cmake
https://github.com/InsightSoftwareConsortium/ITKExamples/blob/master/CMakeLists.txt#L120-L154
Change-Id: Ic65e7f8ec5280d1e71a897a144417a21761c5553
diff --git a/scripts/make_docs.py b/scripts/make_docs.py
index 8f7e718..efbbf88 100644
--- a/scripts/make_docs.py
+++ b/scripts/make_docs.py
@@ -36,17 +36,28 @@
import os
import sys
-if len(sys.argv) < 3:
+# Number of arguments
+N = len(sys.argv)
+
+if N < 3:
print "make_docs.py src_root destination_root"
sys.exit(1)
-src_dir = sys.argv[1] + "/docs/source"
+src_dir = sys.argv[1] + "/docs/source"
build_root = sys.argv[2]
-doctrees_dir = build_root + "/doctrees"
-html_dir = build_root + "/html"
+cache_dir = build_root + "/doctrees"
+html_dir = build_root + "/html"
+
+# Called from Command Line
+if N == 3:
+ sphinx_exe = "sphinx-build"
+
+# Called from CMake (using the SPHINX_EXECUTABLE found)
+elif N == 4:
+ sphinx_exe = sys.argv[3]
# Run Sphinx to build the documentation.
-os.system("sphinx-build -b html -d %s %s %s" %(doctrees_dir, src_dir, html_dir))
+os.system("%s -b html -d %s %s %s" %(sphinx_exe, cache_dir, src_dir, html_dir))
input_pattern = """config=TeX-AMS-MML_HTMLorMML"></script>"""
output_pattern = """config=TeX-AMS_HTML">
diff --git a/scripts/make_release b/scripts/make_release
index 36643e9..d3ca820 100755
--- a/scripts/make_release
+++ b/scripts/make_release
@@ -40,9 +40,9 @@
TMP="/tmp/ceres-solver-$1"
DOCS_TMP="/tmp/ceres-solver-docs-$1"
-VERSION=$(grep 'SET(CERES_VERSION' CMakeLists.txt | \
- sed -e 's/SET(CERES_VERSION //' | \
- sed -e 's/)//')
+VERSION=$(grep 'SET(CERES_VERSION_' CMakeLists.txt | \
+ sed -e 's/\(.*\) \(.*\))/\2/' | \
+ tr '\n' '.' | sed -e 's/.$//')
ABI_VERSION=$(grep 'SET(CERES_ABI_VERSION' CMakeLists.txt | \
sed -e 's/SET(CERES_ABI_VERSION //' | \
sed -e 's/)//')
@@ -89,9 +89,8 @@
exit 1
fi
-# Clone the repository and clean out the git extras.
-git clone . $TMP
-rm -rf "$TMP/.git"
+# Export repository.
+git checkout-index -f -a --prefix=$TMP/
# Build the VERSION file.
VERSIONFILE=$TMP/VERSION