Skip to content

Commit 3cd0836

Browse files
authored
Merge pull request #100 from alicevision/doc/first
[doc] add readthedocs documentation
2 parents d14aa17 + de86c1c commit 3cd0836

24 files changed

+1288
-180
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

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ before_script:
9292
- mkdir -p ${POPSIFT_BUILD_RELEASE}
9393
- cd ${POPSIFT_BUILD_RELEASE}
9494
- >
95-
cmake . ${POPSIFT_SOURCE} -DCMAKE_INSTALL_PREFIX=${POPSIFT_INSTALL_RELEASE} -DCMAKE_BUILD_TYPE=Release
95+
cmake . ${POPSIFT_SOURCE} -DCMAKE_INSTALL_PREFIX=${POPSIFT_INSTALL_RELEASE} -DCMAKE_BUILD_TYPE=Release -DPopSift_BUILD_DOCS:BOOL=OFF
9696
9797
# Classic debug build
9898
# Create build folder
9999
- mkdir -p ${POPSIFT_BUILD_DEBUG}
100100
- cd ${POPSIFT_BUILD_DEBUG}
101101
- >
102-
cmake . ${POPSIFT_SOURCE} -DCMAKE_INSTALL_PREFIX=${POPSIFT_INSTALL_DEBUG} -DCMAKE_BUILD_TYPE=Debug
102+
cmake . ${POPSIFT_SOURCE} -DCMAKE_INSTALL_PREFIX=${POPSIFT_INSTALL_DEBUG} -DCMAKE_BUILD_TYPE=Debug -DPopSift_BUILD_DOCS:BOOL=OFF
103103
104104
script:
105105
- cd ${POPSIFT_BUILD_RELEASE}
@@ -111,7 +111,7 @@ script:
111111
- cd ${POPSIFT_APP_SRC}
112112
- mkdir -p ${POPSIFT_APP_BUILD_RELEASE}
113113
- cd ${POPSIFT_APP_BUILD_RELEASE}
114-
- cmake .. -DPopSift_DIR=${POPSIFT_INSTALL_RELEASE}/lib/cmake/PopSift/ -DCMAKE_INSTALL_PREFIX=${POPSIFT_APP_INSTALL_RELEASE} -DCMAKE_BUILD_TYPE=Release
114+
- cmake .. -DPopSift_DIR=${POPSIFT_INSTALL_RELEASE}/lib/cmake/PopSift/ -DCMAKE_INSTALL_PREFIX=${POPSIFT_APP_INSTALL_RELEASE} -DCMAKE_BUILD_TYPE=Release -DPopSift_BUILD_DOCS:BOOL=OFF
115115
- make install -j 2 VERBOSE=1
116116

117117
# same for debug
@@ -124,7 +124,7 @@ script:
124124
- cd ${POPSIFT_APP_SRC}
125125
- mkdir -p ${POPSIFT_APP_BUILD_DEBUG}
126126
- cd ${POPSIFT_APP_BUILD_DEBUG}
127-
- cmake .. -DPopSift_DIR=${POPSIFT_INSTALL_DEBUG}/lib/cmake/PopSift/ -DCMAKE_INSTALL_PREFIX=${POPSIFT_APP_INSTALL_DEBUG} -DCMAKE_BUILD_TYPE=Debug
127+
- cmake .. -DPopSift_DIR=${POPSIFT_INSTALL_DEBUG}/lib/cmake/PopSift/ -DCMAKE_INSTALL_PREFIX=${POPSIFT_APP_INSTALL_DEBUG} -DCMAKE_BUILD_TYPE=Debug -DPopSift_BUILD_DOCS:BOOL=OFF
128128
- make install -j 2 VERBOSE=1
129129

130130
cache:

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_NAME}-$
88
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
99

1010
option(PopSift_BUILD_EXAMPLES "Build PopSift applications." ON)
11+
option(PopSift_BUILD_DOCS "Build PopSift documentation." OFF)
1112
option(PopSift_USE_NVTX_PROFILING "Use CUDA NVTX for profiling." OFF)
1213
option(PopSift_ERRCHK_AFTER_KERNEL "Synchronize and check CUDA error after every kernel." OFF)
1314
option(PopSift_USE_POSITION_INDEPENDENT_CODE "Generate position independent code." ON)
@@ -200,6 +201,10 @@ endif()
200201

201202
add_subdirectory(src)
202203

204+
if(PopSift_BUILD_DOCS)
205+
add_subdirectory(doc)
206+
endif()
207+
203208
set(PopSift_TESTFILE_PATH "popsift-samples/datasets/sample/big_set/" CACHE STRING "Base directory where your test files are stored")
204209
if(PopSift_USE_TEST_CMD)
205210
if(NOT IS_ABSOLUTE("${PopSift_TESTFILE_PATH}"))
@@ -229,6 +234,7 @@ message(STATUS "PopSift version: " ${PROJECT_VERSION})
229234
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
230235
message(STATUS "Build Shared libs: " ${BUILD_SHARED_LIBS})
231236
message(STATUS "Build examples: " ${PopSift_BUILD_EXAMPLES})
237+
message(STATUS "Build documentation: " ${PopSift_BUILD_DOCS})
232238
message(STATUS "Generate position independent code: " ${CMAKE_POSITION_INDEPENDENT_CODE})
233239
message(STATUS "Use CUDA NVTX for profiling: " ${PopSift_USE_NVTX_PROFILING})
234240
message(STATUS "Synchronize and check CUDA error after every kernel: " ${PopSift_ERRCHK_AFTER_KERNEL})

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ install:
2626
before_build:
2727
- md build
2828
- cd build
29-
- cmake -G "Visual Studio 14 2015" -A x64 -T v140,host=x64 -DBUILD_SHARED_LIBS=%DBUILD_SHARED_LIBS% -DPopSift_USE_POSITION_INDEPENDENT_CODE:BOOL=%DBUILD_SHARED_LIBS% -DPopSift_BUILD_EXAMPLES:BOOL=ON -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake ..
29+
- cmake -G "Visual Studio 14 2015" -A x64 -T v140,host=x64 -DBUILD_SHARED_LIBS=%DBUILD_SHARED_LIBS% -DPopSift_BUILD_DOCS:BOOL=OFF -DPopSift_USE_POSITION_INDEPENDENT_CODE:BOOL=%DBUILD_SHARED_LIBS% -DPopSift_BUILD_EXAMPLES:BOOL=ON -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake ..
3030
- ls -l
3131

3232
build:

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/CMakeLists.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
find_package(Doxygen REQUIRED)
2+
3+
file(GLOB_RECURSE ALL_PUBLIC_HEADERS ${PROJECT_SOURCE_DIR}/src/popsift/*.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 faithful implementation of the SIFT algorithm in CUDA.")
7+
set(DOXYGEN_GENERATE_XML YES)
8+
set(DOXYGEN_GENERATE_TREEVIEW YES)
9+
set(DOXYGEN_GENERATE_DEPRECATEDLIST YES)
10+
set(DOXYGEN_SORT_BRIEF_DOCS YES)
11+
set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
12+
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIRECTORY}/xml/index.xml)
13+
14+
doxygen_add_docs(doxygen
15+
${ALL_PUBLIC_HEADERS} ${CCTAG_OTHER_DOC_SOURCES}
16+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
17+
COMMENT "Generate the doc")
18+
19+
20+
21+
find_package(Sphinx REQUIRED)
22+
23+
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/source)
24+
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/sphinx)
25+
26+
add_custom_target(sphinx ALL
27+
COMMAND
28+
${SPHINX_EXECUTABLE} -b html
29+
# Tell Breathe where to find the Doxygen output
30+
-Dbreathe_projects.PopSift=${DOXYGEN_OUTPUT_DIRECTORY}/xml
31+
${SPHINX_SOURCE} ${SPHINX_BUILD}
32+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
33+
DEPENDS
34+
doxygen
35+
# Other docs files you want to track should go here (or in some variable)
36+
${CMAKE_CURRENT_SOURCE_DIR}/sphinx/source/index.rst
37+
${DOXYGEN_INDEX_FILE}
38+
# MAIN_DEPENDENCY ${SPHINX_SOURCE}/conf.py
39+
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

doc/sphinx/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sphinx>=1.9.0
2+
sphinx_rtd_theme
3+
sphinxcontrib-bibtex
4+
breathe

0 commit comments

Comments
 (0)