Skip to content

Commit

Permalink
Adding sphinx to target doc2 cmake build
Browse files Browse the repository at this point in the history
  • Loading branch information
cepellotti committed Dec 11, 2020
1 parent 7e341a5 commit 0cd5ac4
Show file tree
Hide file tree
Showing 30 changed files with 37 additions and 5 deletions.
23 changes: 20 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ set(CMAKE_CXX_STANDARD 14)

project(Phoebe C CXX Fortran)

## load custom cmake find_package
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
SET(GCC_COVERAGE_COMPILE_FLAGS "-Wall -Wextra -ggdb -fno-omit-frame-pointer -Wno-deprecated-copy -Wno-ignored-attributes")
add_definitions(${GCC_COVERAGE_COMPILE_FLAGS})
Expand Down Expand Up @@ -144,14 +147,15 @@ endif()
############# DOCS ############

find_package(Doxygen)
find_package(Sphinx)

IF (BUILD_DOC)
IF (NOT DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
else()
# set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile.out)
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/Doxyfile)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/doc/doxygen/Doxyfile.out)

# request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
Expand All @@ -161,9 +165,22 @@ IF (BUILD_DOC)
add_custom_target(
doc
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_IN}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../doc
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../doc/doxygen
COMMENT "Generating API documentation with Doxygen"
VERBATIM)

IF (NOT SPHINX_FOUND)
message("Documentation needs also sphinx")
else()
add_custom_target(
doc2
COMMAND make html
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../doc/sphinx
COMMENT "Building user documentation with Sphinx"
VERBATIM)
endif()
ENDIF()
endif()



14 changes: 14 additions & 0 deletions cmake/FindSphinx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
find_program(SPHINX_EXECUTABLE NAMES sphinx-build
HINTS
$ENV{SPHINX_DIR}
PATH_SUFFIXES bin
DOC "Sphinx documentation generator"
)

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(Sphinx DEFAULT_MSG
SPHINX_EXECUTABLE
)

mark_as_advanced(SPHINX_EXECUTABLE)
2 changes: 1 addition & 1 deletion doc/Doxyfile → doc/doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ WARN_LOGFILE =
INPUT = ./doc_pages/developerOverview.md \
./doc_pages/Units.md \
./doc_pages/UnitTesting.md \
../src/
../../src/

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/source/index.rst → doc/sphinx/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Welcome to Phoebe's documentation!
postProcessing
tutorials/tutorials
theory/theory
Developers' documentation <../../html/index.html#http://>
Developers' documentation <../../../doxygen/html/index.html#http://>

This is the documentation of Phoebe's project.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ On top of that, you should also see several files named as `{prefix}.phoebe.****
These files contain the values of the electron-phonon coupling that will be used by Phoebe.

*Current limitations:*

* There are restrictions to the choice of k and q points.
The `K_POINTS` in `pw.x` must be `automatic`. The `K_POINTS` must be gamma centered.
And the q-point mesh must be the same as the k-point mesh.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0cd5ac4

Please sign in to comment.