set(EXPECTED_SPHINX_VERSION 1.6.1)
-if (DEFINED PYTHON_EXECUTABLE)
- # Keep quiet on subsequent runs of cmake
- set(PythonInterp_FIND_QUIETLY ON)
-endif()
-find_package(PythonInterp 2.7)
-
-
-if (NOT ${PYTHON_VERSION_MAJOR} EQUAL 3)
- find_package(Sphinx ${EXPECTED_SPHINX_VERSION} QUIET COMPONENTS pygments)
-else()
- MESSAGE(STATUS "Can not build documentation with Python 3")
+# By default, suppress output after first configuration.
+if(SPHINX_ALREADY_SEARCHED)
+ set(Sphinx_FIND_QUIETLY ON)
endif()
+find_package(Sphinx ${EXPECTED_SPHINX_VERSION} COMPONENTS pygments)
+set(SPHINX_ALREADY_SEARCHED TRUE CACHE BOOL "True if a search for Sphinx has already been done")
+mark_as_advanced(SPHINX_ALREADY_SEARCHED)
# Even if we aren't going to make the full webpage, set up to put all
# the documentation output in the same place, for convenience
set(MANUAL_BUILD_NOT_POSSIBLE_REASON "the build is in-source")
else()
include(manual/UseLATEX.cmake)
- if(${PYTHON_VERSION_MAJOR} EQUAL 3)
- set(MANUAL_BUILD_IS_POSSIBLE OFF)
- set(MANUAL_BUILD_NOT_POSSIBLE_REASON "We can not build the documentation when using python3")
- elseif(NOT SPHINX_FOUND)
+ if(NOT SPHINX_FOUND)
set(MANUAL_BUILD_IS_POSSIBLE OFF)
set(MANUAL_BUILD_NOT_POSSIBLE_REASON "Sphinx has not been found and is needed to create the LaTex input files")
elseif(NOT PDFLATEX_COMPILER)
reference-manual/special/vmd-imd.rst
reference-manual/special/membrane-embedding.rst
reference-manual/special/mimic-qmmm.rst
+ reference-manual/special/density-guided-simulation.rst
# Analysis chapter
reference-manual/analysis.rst
reference-manual/analysis/using-groups.rst
reference-manual/analysis/rmsd.rst
reference-manual/analysis/covariance-analysis.rst
reference-manual/analysis/dihedral-pca.rst
+ reference-manual/analysis/hydrogen-bonds.rst
reference-manual/analysis/protein-related.rst
reference-manual/analysis/interface-related.rst)
# The image files have also been ordered by the respective
dev-manual/style.rst
dev-manual/testutils.rst
dev-manual/tools.rst
- dev-manual/uncrustify.rst
+ dev-manual/code-formatting.rst
fragments/doxygen-links.rst
how-to/index.rst
how-to/beginners.rst
how-to/visualize.rst
install-guide/index.rst
release-notes/index.rst
+ release-notes/2020/major/highlights.rst
+ release-notes/2020/major/features.rst
+ release-notes/2020/major/performance.rst
+ release-notes/2020/major/tools.rst
+ release-notes/2020/major/bugs-fixed.rst
+ release-notes/2020/major/removed-functionality.rst
+ release-notes/2020/major/deprecated-functionality.rst
+ release-notes/2020/major/portability.rst
+ release-notes/2020/major/miscellaneous.rst
release-notes/2019/2019.6.rst
release-notes/2019/2019.5.rst
release-notes/2019/2019.4.rst
# if the documentation will be build with the full reference
# manual or without.
user-guide/cmdline.rst
- user-guide/cutoff-schemes.rst
user-guide/deprecation-policy.rst
user-guide/environment-variables.rst
user-guide/faq.rst
endif()
set(SPHINX_CONFIG_VARS_FILE ${SPHINX_INPUT_DIR}/conf-vars.py)
+ if (GMX_PYTHON_PACKAGE)
+ set(GMXAPI_PYTHON_STAGING_DIR ${CMAKE_BINARY_DIR}/python_packaging/src/gmxapi_staging)
+ # TODO: Resolve circular reference. We would like to get the CMake build-time directory for
+ # the gmxapi Python package from the _gmxapi target, as we do when building sample_restraint.
+ # Instead of the above hard-coded path, how can we do
+ # get_target_property(GMXAPI_PYTHON_STAGING_DIR _gmxapi staging_dir)
+ # in this context?
+ endif ()
+
gmx_configure_version_file(conf-vars.py.cmakein ${SPHINX_CONFIG_VARS_FILE}
EXTRA_VARS
SPHINX_EXTENSION_PATH RELENG_PATH
GMX_LMFIT_REQUIRED_VERSION
GMX_MANUAL_DOI_STRING
GMX_SOURCE_DOI_STRING
+ GMXAPI_PYTHON_STAGING_DIR
COMMENT "Configuring Sphinx configuration file")
gmx_add_sphinx_input_file(${SPHINX_CONFIG_VARS_FILE})
gmx_add_sphinx_source_files(FILES ${SPHINX_SOURCE_FILES})
dev-manual/releng/jenkins-ui.rst
)
endif()
+
+ gmx_add_sphinx_source_files(
+ FILES
+ gmxapi/index.rst
+ gmxapi/userguide/install.rst
+ gmxapi/userguide/usage.rst
+ gmxapi/userguide/userguide.rst
+ )
+
+ if (GMX_PYTHON_PACKAGE)
+ gmx_add_sphinx_source_files(
+ FILES
+ gmxapi/userguide/pythonreference.rst
+ )
+ else()
+ gmx_add_sphinx_source_files(
+ FROM ${CMAKE_CURRENT_SOURCE_DIR}/gmxapi/userguide-stub
+ TO gmxapi/userguide/
+ FILES pythonreference.rst
+ )
+ endif ()
+
gmx_add_sphinx_source_files(
FILES
${REFERENCEMANUAL_SPHINX_FILES_GENERAL})
gmx_add_sphinx_image_conversion_target(sphinx-image-conversion)
add_custom_target(sphinx-input)
add_dependencies(sphinx-input sphinx-input-rst sphinx-image-conversion)
+ if (GMX_PYTHON_PACKAGE)
+ add_dependencies(sphinx-input _gmxapi)
+ endif()
# Remove other rst files from the build tree, since they confuse Sphinx.
# Skip generated files in onlinehelp/, and fragments.
# The latter do not cause issues with obsolete files, as they
add_custom_target(install-guide
COMMAND
${SPHINX_EXECUTABLE}
- -q -E -b text
+ -q -b text
-w sphinx-install.log
-d ${CMAKE_CURRENT_BINARY_DIR}/install-guide/_doctrees
-c ${SPHINX_INPUT_DIR}
add_custom_target(webpage-sphinx
DEPENDS sphinx-programs
DEPENDS sphinx-input
- DEPENDS sphinx-image-conversion
+ DEPENDS sphinx-image-conversion
+ DEPENDS manual
COMMAND
${CMAKE_COMMAND} -E make_directory ${SPHINX_INPUT_DIR}/_static
COMMAND
${SPHINX_EXECUTABLE}
- -q -E -b html
+ -q -b html
-w sphinx-html.log
-d "${SPHINX_CACHE_DIR}"
"${SPHINX_INPUT_DIR}"
add_custom_target(man
COMMAND
${SPHINX_EXECUTABLE}
- -q -E -b man
+ -q -b man
-w sphinx-man.log
-d ${SPHINX_CACHE_DIR}
-t do_man
set(HTML_BUILD_WARNINGS)
# Next, turn it off if any of the preconditions are unsatisified
-if (NOT PYTHON_EXECUTABLE)
+if (NOT PythonInterp_FOUND)
set(HTML_BUILD_IS_POSSIBLE OFF)
set(HTML_BUILD_NOT_POSSIBLE_REASON "Python is required")
elseif (NOT SPHINX_FOUND)