Skip to content

Commit

Permalink
doc: change to read the doc
Browse files Browse the repository at this point in the history
Signed-off-by: Loic Reyreaud <loic.reyreaud@epita.fr>
  • Loading branch information
Loic Reyreaud committed Aug 19, 2018
1 parent aea91f6 commit 1fc6626
Show file tree
Hide file tree
Showing 14 changed files with 243 additions and 169 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
build/
doc/Doxyfile
doxyxml
_build
build

# Prerequisites
*.d

Expand Down
25 changes: 3 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,15 @@
sudo: false

branches:
except:
- gh-pages

# Environment variables
env:
global:
- GH_REPO_NAME: threadpool
- DOXYGEN_HTML: $TRAVIS_BUILD_DIR/build/doc/html
- GH_REPO_REF: github.com/reyreaud-l/threadpool.git
git:
quiet: true

addons:
apt:
packages:
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen-gui
- graphviz
- cmake

script:
- mkdir build
- cd build
- cmake -DBUILD_TESTS=ON -DBUILD_DOC=ON ..
- cmake -DBUILD_TESTS=ON ..
- make check
- make doc

after_success:
- cd $TRAVIS_BUILD_DIR
- chmod +x gen_doc_gh_page.sh
- ./gen_doc_gh_pages.sh
43 changes: 15 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,58 +1,45 @@
cmake_minimum_required(VERSION 3.9)
set(LIB threadpool)
project(${LIB} CXX)
project(${LIB} LANGUAGES CXX VERSION 0.1)

option(BUILD_DOC "Build documentation" OFF)
option(BUILD_TESTS "Build tests" OFF)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

# CMake generators if no build type is set.
# If no build type is set, set to release.
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RELEASE)
endif(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE_SUFFIX)


if ((BUILD_DOC) OR (${CMAKE_BUILD_TYPE} MATCHES "RELEASE"))
add_subdirectory(doc)
endif()

# Uninstall target
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_MODULE_PATH}/uninstall.cmake.in"
"${CMAKE_MODULE_PATH}/uninstall.cmake"
IMMEDIATE @ONLY
)

add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_MODULE_PATH}/uninstall.cmake)
endif()

# Threads kinda of is required (obviously)
find_package(Threads REQUIRED)

# Compilation settings (for tests mainly)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic")
set(CMAKE_CXX_FLAGS_DEBUG "-g3 -O0 -fsanitize=address")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

add_subdirectory(include)

# Tests
if ((BUILD_TESTS) OR (NOT CMAKE_BUILD_TYPE MATCHES "RELEASE"))
add_subdirectory(tests)
endif()

message(STATUS "-------------------------------")
message(STATUS "++ Setup: ")
message(STATUS "System: " ${CMAKE_SYSTEM})
message(STATUS "Build dir: " ${CMAKE_BINARY_DIR})
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
message(STATUS "CXX: " ${CMAKE_CXX_COMPILER_ID})
message(STATUS "CXXFLAGS: " ${CMAKE_CXX_FLAGS} " " ${CMAKE_CXX_FLAGS_${BUILD_TYPE_SUFFIX}})
message(STATUS "Verbose: " ${CMAKE_VERBOSE_MAKEFILE})
message(STATUS "System: " ${CMAKE_SYSTEM})
message(STATUS "Build dir: " ${CMAKE_BINARY_DIR})
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
message(STATUS "CXX: " ${CMAKE_CXX_COMPILER_ID})
message(STATUS "CXXFLAGS: " ${CMAKE_CXX_FLAGS} " " ${CMAKE_CXX_FLAGS_${BUILD_TYPE_SUFFIX}})
message(STATUS "Verbose: " ${CMAKE_VERBOSE_MAKEFILE})
message(STATUS "")
message(STATUS "++ Lib Info")
message(STATUS "ar: " ${CMAKE_AR})
message(STATUS "ranlib: " ${CMAKE_RANLIB})
message(STATUS "ar: " ${CMAKE_AR})
message(STATUS "ranlib: " ${CMAKE_RANLIB})
message(STATUS "++ Options")
message(STATUS "Tests: " ${BUILD_TESTS})
message(STATUS "-------------------------------")
4 changes: 0 additions & 4 deletions doc/CMakeLists.txt

This file was deleted.

18 changes: 9 additions & 9 deletions doc/Doxyfile.in → doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "ThreadPool"
PROJECT_NAME = "Threadpool"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER =
PROJECT_NUMBER = "0.1"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand All @@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/doc_doxygen/
OUTPUT_DIRECTORY =

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down Expand Up @@ -442,7 +442,7 @@ EXTRACT_ALL = NO
# be included in the documentation.
# The default value is: NO.

EXTRACT_PRIVATE = YES
EXTRACT_PRIVATE = NO

# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation.
Expand Down Expand Up @@ -791,7 +791,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = @CMAKE_SOURCE_DIR@/include/ @CMAKE_SOURCE_DIR@/doc
INPUT = ../include

# 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 Expand Up @@ -1104,7 +1104,7 @@ IGNORE_PREFIX =
# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
# The default value is: YES.

GENERATE_HTML = YES
GENERATE_HTML = NO

# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
Expand Down Expand Up @@ -1656,7 +1656,7 @@ EXTRA_SEARCH_MAPPINGS =
# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
# The default value is: YES.

GENERATE_LATEX = YES
GENERATE_LATEX = NO

# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
Expand Down Expand Up @@ -1936,15 +1936,15 @@ MAN_LINKS = NO
# captures the structure of the code including all documentation.
# The default value is: NO.

GENERATE_XML = NO
GENERATE_XML = YES

# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: xml.
# This tag requires that the tag GENERATE_XML is set to YES.

XML_OUTPUT = xml
XML_OUTPUT = doxyxml

# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
Expand Down
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = threadpool
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
151 changes: 151 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import os
import sys

def generate_doxygen_xml(app):
from subprocess import call
doxdir = os.path.abspath(os.path.dirname(__file__))
call('cd %s; doxygen' % doxdir, shell=True)

def setup(app):
# Add hook for building doxygen xml when needed
app.connect("builder-inited", generate_doxygen_xml)

# -- Project information -----------------------------------------------------

project = 'threadpool'
copyright = '2018, Loic Reyreaud'
author = 'Loic Reyreaud'

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '0.1'


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'breathe',
]

breathe_projects = { "threadpool-doxygen": "doxyxml/" }
breathe_default_project = "threadpool-doxygen"

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'threadpooldoc'

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'threadpool.tex', 'threadpool Documentation',
'Loic Reyreaud', 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'threadpool', 'threadpool Documentation',
[author], 1)
]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'threadpool', 'threadpool Documentation',
author, 'threadpool', 'One line description of project.',
'Miscellaneous'),
]

0 comments on commit 1fc6626

Please sign in to comment.