Skip to content

Commit 0cd5ac4

Browse files
committed
Adding sphinx to target doc2 cmake build
1 parent 7e341a5 commit 0cd5ac4

30 files changed

+37
-5
lines changed

CMakeLists.txt

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ set(CMAKE_CXX_STANDARD 14)
1313

1414
project(Phoebe C CXX Fortran)
1515

16+
## load custom cmake find_package
17+
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
18+
1619
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
1720
SET(GCC_COVERAGE_COMPILE_FLAGS "-Wall -Wextra -ggdb -fno-omit-frame-pointer -Wno-deprecated-copy -Wno-ignored-attributes")
1821
add_definitions(${GCC_COVERAGE_COMPILE_FLAGS})
@@ -144,14 +147,15 @@ endif()
144147
############# DOCS ############
145148

146149
find_package(Doxygen)
150+
find_package(Sphinx)
147151

148152
IF (BUILD_DOC)
149153
IF (NOT DOXYGEN_FOUND)
150154
message("Doxygen need to be installed to generate the doxygen documentation")
151155
else()
152156
# set input and output files
153-
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile)
154-
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile.out)
157+
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/Doxyfile)
158+
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/doc/doxygen/Doxyfile.out)
155159

156160
# request to configure the file
157161
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
@@ -161,9 +165,22 @@ IF (BUILD_DOC)
161165
add_custom_target(
162166
doc
163167
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_IN}
164-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../doc
168+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../doc/doxygen
165169
COMMENT "Generating API documentation with Doxygen"
166170
VERBATIM)
171+
172+
IF (NOT SPHINX_FOUND)
173+
message("Documentation needs also sphinx")
174+
else()
175+
add_custom_target(
176+
doc2
177+
COMMAND make html
178+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../doc/sphinx
179+
COMMENT "Building user documentation with Sphinx"
180+
VERBATIM)
181+
endif()
167182
ENDIF()
168183
endif()
169184

185+
186+

cmake/FindSphinx.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
find_program(SPHINX_EXECUTABLE NAMES sphinx-build
2+
HINTS
3+
$ENV{SPHINX_DIR}
4+
PATH_SUFFIXES bin
5+
DOC "Sphinx documentation generator"
6+
)
7+
8+
include(FindPackageHandleStandardArgs)
9+
10+
find_package_handle_standard_args(Sphinx DEFAULT_MSG
11+
SPHINX_EXECUTABLE
12+
)
13+
14+
mark_as_advanced(SPHINX_EXECUTABLE)

doc/Doxyfile renamed to doc/doxygen/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ WARN_LOGFILE =
832832
INPUT = ./doc_pages/developerOverview.md \
833833
./doc_pages/Units.md \
834834
./doc_pages/UnitTesting.md \
835-
../src/
835+
../../src/
836836

837837
# This tag can be used to specify the character encoding of the source files
838838
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
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.

doc/source/index.rst renamed to doc/sphinx/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Welcome to Phoebe's documentation!
1414
postProcessing
1515
tutorials/tutorials
1616
theory/theory
17-
Developers' documentation <../../html/index.html#http://>
17+
Developers' documentation <../../../doxygen/html/index.html#http://>
1818

1919
This is the documentation of Phoebe's project.
2020

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.

doc/source/tutorials/elEpaTransport.rst renamed to doc/sphinx/source/tutorials/elEpaTransport.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ On top of that, you should also see several files named as `{prefix}.phoebe.****
157157
These files contain the values of the electron-phonon coupling that will be used by Phoebe.
158158

159159
*Current limitations:*
160+
160161
* There are restrictions to the choice of k and q points.
161162
The `K_POINTS` in `pw.x` must be `automatic`. The `K_POINTS` must be gamma centered.
162163
And the q-point mesh must be the same as the k-point mesh.

0 commit comments

Comments
 (0)