Skip to content

Instantly share code, notes, and snippets.

View smrfeld's full-sized avatar
🙂

Oliver K. Ernst smrfeld

🙂
View GitHub Profile
@smrfeld
smrfeld / CMakeLists.txt
Created June 24, 2020 22:04
Basic CMake from VS code
cmake_minimum_required(VERSION 3.0.0)
project(cpp_doxygen_sphinx VERSION 0.1.0)
include(CTest)
enable_testing()
add_library(cpp_doxygen_sphinx cpp_doxygen_sphinx.cpp)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
#include <iostream>
#include <string>
class Foo {
void say_hello(std::string message) const;
};
#include "../include/cpp_doxygen_sphinx.hpp"
void Foo::say_hello(std::string message) const {
std::cout << "Hello: " << message << std::endl;
}
@smrfeld
smrfeld / CMakeLists.txt
Created June 24, 2020 22:11
Better CMake
cmake_minimum_required(VERSION 3.0.0)
set(CMAKE_CXX_FLAGS_DEBUG "-O3 -Wall")
project(cpp_doxygen_sphinx VERSION 0.1.0)
include(CTest)
enable_testing()
# Source and header dir
@smrfeld
smrfeld / CMakeLists.txt
Created June 24, 2020 22:15
CMake Doxygen
# Doxygen
# look for Doxygen package
find_package(Doxygen)
if (DOXYGEN_FOUND)
# set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs_doxygen/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.out)
@smrfeld
smrfeld / cpp_doxygen_sphinx.hpp
Created June 24, 2020 22:18
Header with docs
#include <iostream>
#include <string>
/// Foo
class Foo {
/// Say hello
/// @param message The message to print
void say_hello(std::string message) const;
#include <iostream>
void say_hello(){
std::cout << "Hello, from cpp_doxygen_sphinx!\n";
}
@smrfeld
smrfeld / conf.py
Created June 24, 2020 22:43
Conf.py default
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
@smrfeld
smrfeld / conf.py
Created June 24, 2020 22:44
Conf.py with RTD
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme_options = {
'canonical_url': '',
'analytics_id': '',
'display_version': True,
'prev_next_buttons_location': 'bottom',
'style_external_links': False,
@smrfeld
smrfeld / conf.py
Created June 24, 2020 22:47
Complete conf.py with RTD and Doxygen
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- 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