summaryrefslogtreecommitdiffstats
path: root/base/common/python/CMakeLists.txt
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2015-05-26 10:46:57 -0400
committerEndi S. Dewata <edewata@redhat.com>2015-05-28 12:02:03 -0400
commit68590caf838d7ef808d9b4c103df87530a9fe4aa (patch)
treefc3e6e7749dcf27962874ed5b05de39ba7c82d9c /base/common/python/CMakeLists.txt
parentc695c2abf0a2edb4878c1cf01fd3222821ae8fc9 (diff)
downloadpki-68590caf838d7ef808d9b4c103df87530a9fe4aa.tar.gz
pki-68590caf838d7ef808d9b4c103df87530a9fe4aa.tar.xz
pki-68590caf838d7ef808d9b4c103df87530a9fe4aa.zip
Cleaned up python docs generation.
The script to generate Python docs has been cleaned up and simplified. The python-sphinx configuration files have been moved into base/common/python. The build artifacts are now created in the build/base/common/python.
Diffstat (limited to 'base/common/python/CMakeLists.txt')
-rw-r--r--base/common/python/CMakeLists.txt63
1 files changed, 63 insertions, 0 deletions
diff --git a/base/common/python/CMakeLists.txt b/base/common/python/CMakeLists.txt
new file mode 100644
index 000000000..7c2fad869
--- /dev/null
+++ b/base/common/python/CMakeLists.txt
@@ -0,0 +1,63 @@
+find_package(Sphinx REQUIRED)
+
+if(NOT DEFINED SPHINX_THEME)
+ set(SPHINX_THEME default)
+endif()
+
+if(NOT DEFINED SPHINX_THEME_DIR)
+ set(SPHINX_THEME_DIR)
+endif()
+
+configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/conf.py"
+ "${CMAKE_CURRENT_BINARY_DIR}/conf.py"
+ @ONLY)
+
+add_custom_target(dogtag_python_client_docs ALL
+ ${SPHINX_EXECUTABLE}
+ -b html
+ -c "${CMAKE_CURRENT_BINARY_DIR}"
+ -w "${CMAKE_CURRENT_BINARY_DIR}/python-client-lib-html.log"
+ -a
+ "${CMAKE_CURRENT_SOURCE_DIR}"
+ "${CMAKE_CURRENT_BINARY_DIR}/html"
+ COMMENT "Building Python Client Library HTML documentation")
+
+add_custom_target(dogtag_python_client_man_docs ALL
+ ${SPHINX_EXECUTABLE}
+ -b man
+ -c "${CMAKE_CURRENT_BINARY_DIR}"
+ -w "${CMAKE_CURRENT_BINARY_DIR}/python-client-lib-man.log"
+ -a
+ "${CMAKE_CURRENT_SOURCE_DIR}"
+ "${CMAKE_CURRENT_BINARY_DIR}/man"
+ COMMENT "Building Python Client Library manual pages")
+
+install(
+ DIRECTORY
+ pki
+ DESTINATION
+ ${PYTHON_SITE_PACKAGES}
+)
+
+install(
+ DIRECTORY
+ ${CMAKE_CURRENT_BINARY_DIR}/html
+ DESTINATION
+ ${SHARE_INSTALL_PREFIX}/doc/pki-base/
+ PATTERN
+ .buildinfo EXCLUDE
+ PATTERN
+ .doctrees EXCLUDE
+)
+
+install(
+ DIRECTORY
+ ${CMAKE_CURRENT_BINARY_DIR}/man/
+ DESTINATION
+ ${MAN_INSTALL_DIR}/man1
+ PATTERN
+ .buildinfo EXCLUDE
+ PATTERN
+ .doctrees EXCLUDE
+)