-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from renn0xtek9/add-documentation
add documentation
- Loading branch information
Showing
15 changed files
with
150 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
# Base image | ||
FROM mcr.microsoft.com/devcontainers/base:jammy | ||
|
||
COPY setup_environment_on_ubuntu_22.sh . | ||
COPY setup_build_environment_on_ubuntu_22.sh . | ||
COPY setup_documentation_environment_on_ubuntu_22.sh . | ||
COPY requirements.txt . | ||
RUN chmod +x setup_environment_on_ubuntu_22.sh | ||
RUN ./setup_environment_on_ubuntu_22.sh | ||
RUN chmod +x setup_build_environment_on_ubuntu_22.sh | ||
RUN chmod +x setup_documentation_environment_on_ubuntu_22.sh | ||
RUN ./setup_build_environment_on_ubuntu_22.sh | ||
RUN ./setup_documentation_environment_on_ubuntu_22.sh | ||
|
||
WORKDIR /workspace | ||
|
||
CMD ["/bin/bash"] | ||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
.devcontainer/setup_documentation_environment_on_ubuntu_22.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
DEBIAN_FRONTEND=noninteractive | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
cd "$DIR" | ||
sudo apt-get update | ||
sudo apt-get install -y cmake git texlive-full biber doxygen graphviz makefile2graph | ||
python3 -m pip install -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build/* | ||
output/* | ||
documentation/*.bbl | ||
documentation/*.blg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
MACRO (CreateLatexDocument _name _texsrc _resources _bibliography) | ||
FIND_PROGRAM (BIBER biber) | ||
FIND_PROGRAM (PDFLATEX pdflatex) | ||
FIND_PROGRAM (MAKEINDEX makeindex) | ||
|
||
IF (${BIBER}-NOTFOUND) | ||
MESSAGE (FATAL_ERROR "biber not found!") | ||
ENDIF () | ||
IF (${PDFLATEX}-NOTFOUND) | ||
MESSAGE (FATAL_ERROR "pdflatex not found!") | ||
ENDIF () | ||
IF (${MAKEINDEX}-NOTFOUND) | ||
MESAGE (FATAL_ERROR "pdflatex not found!") | ||
ENDIF () | ||
SET (_output_folder "${CMAKE_CURRENT_BINARY_DIR}/${_name}/") | ||
FILE (MAKE_DIRECTORY ${_output_folder}) | ||
|
||
ADD_CUSTOM_TARGET ( | ||
${_name} | ||
DEPENDS ${_output_folder}/${_name}.pdf | ||
SOURCES ${_texsrc}) | ||
|
||
ADD_CUSTOM_COMMAND ( | ||
OUTPUT ${_output_folder}/${_name}.pdf | ||
DEPENDS ${_texsrc} ${_resources} ${_bibliography} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
COMMENT "Generating ${_name}" | ||
VERBATIM | ||
COMMAND ${PDFLATEX} -output-directory ${_output_folder} | ||
${CMAKE_CURRENT_SOURCE_DIR}/${_name}.tex | ||
COMMAND ${BIBER} --input-directory ${_output_folder} --output-directory | ||
${_output_folder} ${_name}.bcf | ||
COMMAND cd ${_output_folder} && ${MAKEINDEX} ${_name}.idx | ||
COMMAND cd ${_output_folder} && ${MAKEINDEX} ${_name}.nlo -s nomencl.ist -o | ||
${_name}.nls | ||
COMMAND cd ${_output_folder} && ${MAKEINDEX} -s ${_name}.ist -t ${_name}.glg | ||
-o ${_name}.gls ${_name}.glo | ||
COMMAND cd ${_output_folder} && ${MAKEINDEX} -s ${_name}.ist -t ${_name}.alg | ||
-o ${_name}.acr ${_name}.acn | ||
COMMAND ${PDFLATEX} -output-directory ${_output_folder} | ||
${CMAKE_CURRENT_SOURCE_DIR}/${_name}.tex) | ||
|
||
ENDMACRO () |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
INCLUDE (CreateLatexDocumentation) | ||
INCLUDE (CreateLatexDocument) | ||
|
||
SET (requirements_documents "requirements_document") | ||
SET (SOFTWARE_INTERN_MAIN_TEX ${requirements_documents}.tex) | ||
SET (SOFTWARE_INTERN_RESOURCES_FILES | ||
SET (requirements_document "requirements_document") | ||
SET (REQUIREMENTS_DOCUMENT_MAIN_TEX ${requirements_document}.tex) | ||
SET (REQUIREMENTS_DOCUMENTS_RESOURCES_FILES | ||
${CMAKE_CURRENT_SOURCE_DIR}/resources/project_or_company_logo.png) | ||
SET (SOFTWARE_INTERN_BIBLIOGRAPHY ${CMAKE_CURRENT_SOURCE_DIR}/library.bib) | ||
SET (REQUIREMENTS_DOCUMENTS_BIBLIOGRAPHY | ||
${CMAKE_CURRENT_SOURCE_DIR}/library.bib) | ||
|
||
CREATELATEXDOCUMENTAION ( | ||
"${requirements_documents}" "${SOFTWARE_INTERN_MAIN_TEX}" | ||
"${SOFTWARE_INTERN_RESOURCES_FILES}" "${SOFTWARE_INTERN_BIBLIOGRAPHY}") | ||
CREATELATEXDOCUMENT ( | ||
"${requirements_document}" "${REQUIREMENTS_DOCUMENT_MAIN_TEX}" | ||
"${REQUIREMENTS_DOCUMENTS_RESOURCES_FILES}" | ||
"${REQUIREMENTS_DOCUMENTS_BIBLIOGRAPHY}") | ||
|
||
# Doxygen documentation | ||
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/code_documentation.doxygen.in | ||
${CMAKE_CURRENT_BINARY_DIR}/code_documentation.doxygen) | ||
ADD_CUSTOM_COMMAND ( | ||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/code_documentation/html/index.html | ||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/code_documentation.doxygen | ||
VERBATIM | ||
COMMAND doxygen ${CMAKE_CURRENT_BINARY_DIR}/code_documentation.doxygen | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
COMMENT "Building code documentation") | ||
ADD_CUSTOM_TARGET ( | ||
documentation | ||
DEPENDS ${requirements_documents} | ||
COMMENT "Building requirements documentation") | ||
code_documentation | ||
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/code_documentation.doxygen.in | ||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/code_documentation/html/index.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Doxyfile | ||
|
||
# Set the project name | ||
PROJECT_NAME = ProjectName | ||
|
||
PROJECT_LOGO = @CMAKE_SOURCE_DIRECTORY@/documentation/resources/project_or_company_logo.png | ||
|
||
# Set the project version | ||
<!-- PROJECT_VERSION = 1.0 --> | ||
|
||
# Set the output directory for the generated documentation | ||
OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/code_documentation/ | ||
CREATE_SUBDIRS = YES | ||
|
||
# Set the input directories for the source code | ||
INPUT = @CMAKE_SOURCE_DIR@/project | ||
RECURSIVE = YES | ||
|
||
# Set the file patterns to include in the documentation | ||
FILE_PATTERNS = *.cpp *.h | ||
|
||
# Enable HTML output | ||
GENERATE_HTML = YES | ||
|
||
# Set the HTML output directory | ||
HTML_OUTPUT = html | ||
|
||
# Enable the generation of a compound index | ||
<!-- GENERATE_HTML_HELP = YES --> | ||
|
||
# Enable the generation of a search index | ||
<!-- GENERATE_SEARCHHELP = YES --> | ||
|
||
GENERATE_TESTLIST = YES | ||
GENERATE_BUGLIST = YES | ||
GENERATE_DEPRECATEDLIST = YES | ||
|
||
|
||
|
||
GENERATE_LATEX = YES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
/*! \file probe.h | ||
\brief Example library with a single free function (probe) | ||
*/ | ||
#include <iostream> | ||
|
||
/*! \fn void Probe | ||
* \brief Probe function | ||
*/ | ||
void Probe(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
/*! \file unit_test.cpp | ||
\brief unit tests of probe library | ||
*/ | ||
|
||
#include <gtest/gtest.h> | ||
#include <probe.h> | ||
|
||
/*! \test ProbeSanity | ||
* \brief Check that the Probe function does not throw | ||
*/ | ||
TEST(ProbeSanity, NoThrow) { | ||
EXPECT_NO_THROW(Probe()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
cd "$DIR"/../build || exit 1 | ||
make requirements_document | ||
make code_documentation |