Skip to content

Commit 19e3b97

Browse files
authored
Merge pull request #135 from alicevision/doc/first
[doc] readthedoc and doxygen documentation
2 parents 99dbd88 + 3b8b156 commit 19e3b97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1844
-559
lines changed

.readthedocs.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: doc/sphinx/source/conf.py
11+
12+
# Optionally build your docs in additional formats such as PDF and ePub
13+
formats: all
14+
15+
# Optionally set the version of Python and requirements required to build your docs
16+
python:
17+
version: 3.7
18+
install:
19+
- requirements: doc/sphinx/requirements.txt

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ option(CCTAG_EIGEN_NO_ALIGN "Disable Eigen alignment" ON)
2626
option(CCTAG_USE_POSITION_INDEPENDENT_CODE "Generate position independent code." ON)
2727
option(CCTAG_ENABLE_SIMD_AVX2 "Enable AVX2 optimizations" OFF)
2828
option(CCTAG_BUILD_TESTS "Build the unity tests" ON)
29+
option(CCTAG_BUILD_DOC "Build documentation" OFF)
2930
option(CCTAG_NO_THRUST_COPY_IF "Do not use thrust::copy_if() on GPU. There may be a bug on CUDA 7 with GTX 980, 980Ti and 1080" OFF)
3031

3132
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
@@ -241,6 +242,10 @@ find_package(TBB REQUIRED)
241242

242243
add_subdirectory(src)
243244

245+
if(CCTAG_BUILD_DOC)
246+
add_subdirectory(doc)
247+
endif()
248+
244249
########### Add uninstall target ###############
245250
configure_file(
246251
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
@@ -261,6 +266,7 @@ message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
261266
message(STATUS "Build Shared libs: " ${BUILD_SHARED_LIBS})
262267
message(STATUS "Build applications: " ${CCTAG_BUILD_APPS})
263268
message(STATUS "Build tests: " ${CCTAG_BUILD_TESTS})
269+
message(STATUS "Build documentation: " ${CCTAG_BUILD_DOC})
264270
message(STATUS "Cuda support: " ${CCTAG_WITH_CUDA})
265271
if(CCTAG_WITH_CUDA)
266272
message(STATUS "Compiling for CUDA CCs: ${ARCH_FLAGS}")
@@ -273,4 +279,4 @@ message(STATUS "[debug] Disable output stream: " ${CCTAG_NO_COUT})
273279
message(STATUS "[debug] nvcc additional warnings: " ${CCTAG_NVCC_WARNINGS})
274280
message(STATUS "Install path: " ${CMAKE_INSTALL_PREFIX})
275281
message("\n******************************************")
276-
message("\n")
282+
message("\n")

cmake/FindSphinx.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Look for an executable called sphinx-build
2+
find_program(SPHINX_EXECUTABLE
3+
NAMES sphinx-build
4+
HINTS ${SPHINX_ROOT}
5+
DOC "Path to sphinx-build executable")
6+
7+
include(FindPackageHandleStandardArgs)
8+
9+
#Handle standard arguments to find_package like REQUIRED and QUIET
10+
find_package_handle_standard_args(Sphinx
11+
"Failed to find sphinx-build executable"
12+
SPHINX_EXECUTABLE)

doc/BUILD-Debian-LABO-v2.md

Lines changed: 0 additions & 117 deletions
This file was deleted.

doc/BUILD-Debian-LABO.md

Lines changed: 0 additions & 116 deletions
This file was deleted.

doc/CMakeLists.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
find_package(Doxygen REQUIRED)
2+
3+
file(GLOB_RECURSE ALL_PUBLIC_HEADERS ${PROJECT_SOURCE_DIR}/src/cctag/*.h*)
4+
set(CCTAG_OTHER_DOC_SOURCES ${PROJECT_SOURCE_DIR}/README.md ${PROJECT_SOURCE_DIR}/INSTALL.md)
5+
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE ${PROJECT_SOURCE_DIR}/README.md)
6+
set(DOXYGEN_PROJECT_BRIEF "A library for detecting markers composed of concentric circles")
7+
set(DOXYGEN_GENERATE_XML YES)
8+
set(DOXYGEN_GENERATE_TREEVIEW YES)
9+
set(DOXYGEN_GENERATE_DEPRECATEDLIST YES)
10+
set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
11+
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIRECTORY}/xml/index.xml)
12+
13+
doxygen_add_docs(doxygen
14+
${ALL_PUBLIC_HEADERS} ${CCTAG_OTHER_DOC_SOURCES}
15+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
16+
COMMENT "Generate the doc")
17+
18+
19+
20+
find_package(Sphinx REQUIRED)
21+
22+
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/source)
23+
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/sphinx)
24+
25+
add_custom_target(sphinx ALL
26+
COMMAND
27+
${SPHINX_EXECUTABLE} -b html
28+
# Tell Breathe where to find the Doxygen output
29+
-Dbreathe_projects.CCTag=${DOXYGEN_OUTPUT_DIRECTORY}/xml
30+
${SPHINX_SOURCE} ${SPHINX_BUILD}
31+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
32+
DEPENDS
33+
doxygen
34+
# Other docs files you want to track should go here (or in some variable)
35+
${CMAKE_CURRENT_SOURCE_DIR}/sphinx/source/index.rst
36+
${DOXYGEN_INDEX_FILE}
37+
# MAIN_DEPENDENCY ${SPHINX_SOURCE}/conf.py
38+
COMMENT "Generating documentation with Sphinx")

doc/sphinx/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

doc/sphinx/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)