Commit 6b85986e authored by Reinhard Biegel's avatar Reinhard Biegel
Browse files

Merge branch 'develop' into 102-port-tests-from-qmake-to-cmake

parents 6eb636f9 7c858132
Pipeline #4866 canceled with stage
in 0 seconds
......@@ -6,7 +6,6 @@ Thumbs.db
*.orig
*.rej
*.user
.qmake*
.directory
.vscode
DoxyGen/Function/doxy_build/*
......@@ -23,3 +22,6 @@ doc/source/api.rst
# third party references
deps/*
# clangd cache
.cache
......@@ -77,4 +77,6 @@ if(INSTALL_SYSTEM_RUNTIME_DEPS OR INSTALL_EXTRA_RUNTIME_DEPS)
include(install_deps)
endif()
include(install_xmlSchemas)
include(CPack)
......@@ -25,7 +25,7 @@ A list of frequently asked questions:
2. __Which traffic signs does openPASS support?__
[Here](https://gitlab.eclipse.org/eclipse/simopenpass/simopenpass/-/blob/servant/sim/doc/DoxyGen/Function/Markdown/Simulation/Development/FrameworkModules.md#L310) is an overview over the supported traffic signs.
[Here](https://gitlab.eclipse.org/eclipse/simopenpass/simopenpass/-/blob/servant/doc/source/advanced_topics/simulator/world_osi.rst#L157) is an overview over the supported traffic signs.
3. __Can openPASS simulate multiple simulation runs in parallel?__
......
################################################################################
# Copyright (c) 2021 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
################################################################################
#
# - Find OSI
# Find the OSI includes and library
# Find Package Adapter for OSI (Open Simulation Interface)
#
# OSI_INCLUDE_DIR - Where to find OSI includes
# OSI_LIBRARIES - List of libraries when using OSI
# OSI_FOUND - True if OSI was found
# Creates the follwoing imported targets (if available):
# - osi::shared
# - osi::static
# - osi::pic
IF(OSI_INCLUDE_DIR)
SET(OSI_FIND_QUIETLY TRUE)
ENDIF(OSI_INCLUDE_DIR)
FIND_PATH(OSI_INCLUDE_DIR "osi3/osi_version.pb.h"
PATHS
${PREFIX_PATH}
$ENV{OSI_HOME}/include
$ENV{EXTERNLIBS}/OSI/include
/usr/local/include
/usr/include
DOC "OSI - Headers"
set(OSI_SHARED_NAMES
open_simulation_interface.lib
libopen_simulation_interface.dll.a
libopen_simulation_interface.so
)
SET(OSI_NAMES
osi3/open_simulation_interface.lib
osi3/libopen_simulation_interface.dll.a
osi3/libopen_simulation_interface_pic.lib
osi3/libopen_simulation_interface.so
set(OSI_STATIC_NAMES
open_simulation_interface_static.lib
libopen_simulation_interface_static.a
)
SET(OSI_DBG_NAMES
osi3/open_simulation_interfaced.lib
osi3/libopen_simulation_interfaced.dll.a
osi3/libopen_simulation_interface_picd.lib
set(OSI_PIC_NAMES
open_simulation_interface_pic.lib
libopen_simulation_interface_pic.a
)
FIND_LIBRARY(OSI_LIBRARY NAMES ${OSI_NAMES}
find_library(OSI_SHARED_LIBRARY NAMES ${OSI_SHARED_NAMES}
PATHS
${PREFIX_PATH}
$ENV{OSI_HOME}
$ENV{EXTERNLIBS}/OSI
/usr/local
/usr
PATH_SUFFIXES lib lib64
DOC "OSI - Library"
${PREFIX_PATH}
/usr/local
/usr
PATH_SUFFIXES
lib/osi3
lib
lib64
)
INCLUDE(FindPackageHandleStandardArgs)
find_library(OSI_STATIC_LIBRARY NAMES ${OSI_STATIC_NAMES}
PATHS
${PREFIX_PATH}
/usr/local
/usr
PATH_SUFFIXES
lib/osi3
lib
lib64
)
IF(MSVC)
# VisualStudio needs a debug version
FIND_LIBRARY(OSI_LIBRARY_DEBUG NAMES ${OSI_DBG_NAMES}
PATHS
find_library(OSI_PIC_LIBRARY NAMES ${OSI_PIC_NAMES}
PATHS
${PREFIX_PATH}
$ENV{OSI_HOME}/lib
$ENV{EXTERNLIBS}/OSI/lib
DOC "OSI - Library (Debug)"
)
/usr/local
/usr
PATH_SUFFIXES
lib/osi3
lib
lib64
)
if(OSI_SHARED_LIBRARY)
message(STATUS "Found OSI (shared): ${OSI_SHARED_LIBRARY}")
IF(OSI_LIBRARY_DEBUG AND OSI_LIBRARY)
SET(OSI_LIBRARIES optimized ${OSI_LIBRARY} debug ${OSI_LIBRARY_DEBUG})
ENDIF(OSI_LIBRARY_DEBUG AND OSI_LIBRARY)
get_filename_component(OSI_SHARED_LIBRARY_DIR "${OSI_SHARED_LIBRARY}" DIRECTORY)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSI DEFAULT_MSG OSI_LIBRARY OSI_LIBRARY_DEBUG OSI_INCLUDE_DIR)
add_library(osi::shared IMPORTED SHARED)
set_target_properties(osi::shared
PROPERTIES
IMPORTED_LOCATION ${OSI_SHARED_LIBRARY}
IMPORTED_IMPLIB ${OSI_SHARED_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${OSI_SHARED_LIBRARY_DIR}/../../include
INTERFACE_LINK_LIBRARIES protobuf::libprotobuf)
else()
message(STATUS "Didn't find OSI (shared)")
endif()
MARK_AS_ADVANCED(OSI_LIBRARY OSI_LIBRARY_DEBUG OSI_INCLUDE_DIR)
ELSE(MSVC)
# rest of the world
SET(OSI_LIBRARIES ${OSI_LIBRARY})
if(OSI_STATIC_LIBRARY)
message(STATUS "Found OSI (static): ${OSI_STATIC_LIBRARY}")
get_filename_component(OSI_STATIC_LIBRARY_DIR "${OSI_STATIC_LIBRARY}" DIRECTORY)
add_library(osi::static IMPORTED STATIC)
set_target_properties(osi::static
PROPERTIES
IMPORTED_LOCATION ${OSI_STATIC_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${OSI_STATIC_LIBRARY_DIR}/../../include
INTERFACE_LINK_LIBRARIES protobuf::libprotobuf_static)
else()
message(STATUS "Didn't find OSI (static)")
endif()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSI DEFAULT_MSG OSI_LIBRARY OSI_INCLUDE_DIR)
MARK_AS_ADVANCED(OSI_LIBRARY OSI_INCLUDE_DIR)
ENDIF(MSVC)
if(OSI_PIC_LIBRARY)
message(STATUS "Found OSI (pic): ${OSI_PIC_LIBRARY}")
get_filename_component(OSI_PIC_LIBRARY_DIR "${OSI_PIC_LIBRARY}" DIRECTORY)
add_library(osi::pic IMPORTED STATIC)
set_target_properties(osi::pic
PROPERTIES
IMPORTED_LOCATION ${OSI_PIC_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${OSI_PIC_LIBRARY_DIR}/../../include
INTERFACE_LINK_LIBRARIES protobuf::libprotobuf_static)
else()
message(STATUS "Didn't find OSI (pic)")
endif()
unset(OSI_SHARED_LIBRARY)
unset(OSI_STATIC_LIBRARY)
unset(OSI_PIC_LIBRARY)
################################################################################
# Copyright (c) 2021 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
################################################################################
#
# find_package adapter for protobuf
#
# Original protpbuf CMake Config file doesn't provide static targets.
#
# Creates the follwoing imported targets (if available):
# - protobuf::libprotobuf
# - protobuf::libprotobuf_static
set(PROTOBUF_SHARED_NAMES
protobuf.lib
libprotobuf.dll.a
libprotobuf.so
)
set(PROTOBUF_STATIC_NAMES
protobuf_static.lib
libprotobuf.a
)
find_library(PROTOBUF_SHARED_LIBRARY NAMES ${PROTOBUF_SHARED_NAMES}
PATHS
${PREFIX_PATH}
/usr/local
/usr
PATH_SUFFIXES
lib
lib64
)
find_library(PROTOBUF_STATIC_LIBRARY NAMES ${PROTOBUF_STATIC_NAMES}
PATHS
${PREFIX_PATH}
/usr/local
/usr
PATH_SUFFIXES
lib
lib64
)
if(PROTOBUF_SHARED_LIBRARY)
message(STATUS "Found protobuf (shared): ${PROTOBUF_SHARED_LIBRARY}")
get_filename_component(PROTOBUF_SHARED_LIBRARY_DIR "${PROTOBUF_SHARED_LIBRARY}" DIRECTORY)
add_library(protobuf::libprotobuf IMPORTED SHARED)
set_target_properties(protobuf::libprotobuf
PROPERTIES
IMPORTED_LOCATION ${PROTOBUF_SHARED_LIBRARY}
IMPORTED_IMPLIB ${PROTOBUF_SHARED_LIBRARY}
INTERFACE_COMPILE_DEFINITIONS PROTOBUF_USE_DLLS
INTERFACE_INCLUDE_DIRECTORIES ${PROTOBUF_SHARED_LIBRARY_DIR}/../include
INTERFACE_LINK_LIBRARIES pthread)
else()
message(STATUS "Didn't find protobuf (shared)")
endif()
if(PROTOBUF_STATIC_LIBRARY)
message(STATUS "Found protobuf (static): ${PROTOBUF_STATIC_LIBRARY}")
get_filename_component(PROTOBUF_STATIC_LIBRARY_DIR "${PROTOBUF_STATIC_LIBRARY}" DIRECTORY)
add_library(protobuf::libprotobuf_static IMPORTED STATIC)
set_target_properties(protobuf::libprotobuf_static
PROPERTIES
IMPORTED_LOCATION ${PROTOBUF_STATIC_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${PROTOBUF_STATIC_LIBRARY_DIR}/../include
INTERFACE_LINK_LIBRARIES pthread)
else()
message(STATUS "Didn't find protobuf (static)")
endif()
unset(PROTOBUF_SHARED_LIBRARY)
unset(PROTOBUF_STATIC_LIBRARY)
......@@ -81,7 +81,7 @@ endif()
# [INCDIRS <include-directories>]
# [LIBRARIES <libraries>]
# [UIS <qt_uis>]
# [LINKOSI])
# [LINKOSI [shared|static]]
# [LINKGUI]
# [FOLDER <category>]
# [COMPONENT <gui|sim|core|bin|module>])
......@@ -94,7 +94,7 @@ endif()
# [INCDIRS <include-directories>]
# [LIBRARIES <libraries>]
# [UIS <qt_uis>]
# [LINKOSI]
# [LINKOSI [shared|static]]
# [LINKGUI]
# [FOLDER <category>]
# [COMPONENT <gui|sim|core|bin|module>])
......@@ -106,7 +106,7 @@ endif()
# [INCDIRS <include-directories>]
# [LIBRARIES <libraries>]
# [UIS <qt_uis>]
# [LINKOSI]
# [LINKOSI [shared|static]]
# [LINKGUI]
# [DEFAULT_MAIN]
# [SIMCORE_DEPS <dependencies>]
......@@ -122,7 +122,7 @@ endif()
# UIS Qt UI files
# INCDIRS Additional include directories
# LIBRARIES Additional libraries to link
# LINKOSI Shortcut for adding OSI include directories and libraries (incl. protobuf)
# LINKOSI Shortcut for adding OSI include directories and libraries (incl. protobuf) as 'static' or 'shared' (default).
# LINKGUI Shortcut for adding GUI Libraries
# DEFAULT_MAIN Links a simple main() implementation for running GTest
# SIMCORE_DEPS Adds dependencies on simulation core targets to a test
......@@ -137,12 +137,13 @@ endif()
# - gtest/gmock/pthread libraries are linked
# - Tests are excluded form the 'all' target
# - If DEFAULT_MAIN argument is provided, adds '--default-xml' to test executable command line arguments
# - PATH and LD_LIBRARY_PATH are set under Windows and Linux, respectively, so that test executables can resolve run-time dependencies.
# - General:
# - Target properties PROJECT_LABEL and OUTPUT_NAME are set to the target's name
# - Target property DEBUG_POSTFIX is set to CMAKE_DEBUG_POSTFIX
##
function(add_openpass_target)
cmake_parse_arguments(PARSED_ARG "LINKGUI;LINKOSI;DEFAULT_MAIN" "NAME;TYPE;LINKAGE" "HEADERS;SOURCES;INCDIRS;LIBRARIES;UIS;SIMCORE_DEPS;RESOURCES;FOLDER;COMPONENT" ${ARGN})
cmake_parse_arguments(PARSED_ARG "LINKGUI;DEFAULT_MAIN" "NAME;TYPE;LINKAGE;LINKOSI" "HEADERS;SOURCES;INCDIRS;LIBRARIES;UIS;SIMCORE_DEPS;RESOURCES;FOLDER;COMPONENT" ${ARGN})
if(TARGET ${PARSED_ARG_NAME})
message(STATUS "Target '${PARSED_ARG_NAME}' already defined. Skipping.")
......@@ -183,10 +184,9 @@ function(add_openpass_target)
else()
install(TARGETS ${PARSED_ARG_NAME} LIBRARY DESTINATION "${DESTDIR}")
endif()
add_to_global_target_list(lib_target_list ${PARSED_ARG_NAME})
endif()
add_to_global_target_list(lib_target_list ${PARSED_ARG_NAME})
if(OPENPASS_ADJUST_OUTPUT)
openpass_adjust_output_dir(${PARSED_ARG_NAME} ${DESTDIR})
endif()
......@@ -275,16 +275,26 @@ function(add_openpass_target)
Boost::headers
)
if(${PARSED_ARG_LINKOSI})
target_include_directories(${PARSED_ARG_NAME} PRIVATE
${OSI_INCLUDE_DIR}
protobuf::libprotobuf
)
# LINKOSI handling
target_link_libraries(${PARSED_ARG_NAME}
${OSI_LIBRARIES}
protobuf::libprotobuf
)
# fallback to default if value is omitted
if("LINKOSI" IN_LIST PARSED_ARG_KEYWORDS_MISSING_VALUES)
set(PARSED_ARG_LINKOSI "shared")
endif()
if(DEFINED PARSED_ARG_LINKOSI)
# validate value
set(VALID_LINKOSI_VALUES "" "shared" "static")
if(NOT "${PARSED_ARG_LINKOSI}" IN_LIST VALID_LINKOSI_VALUES)
message(FATAL_ERROR "Invalid value for LINKOSI. Supported settings are '', 'shared' and 'static'")
endif()
# replace static with pic for library targets
if("${PARSED_ARG_TYPE}" STREQUAL "library" AND "${PARSED_ARG_LINKOSI}" STREQUAL "static")
set(PARSED_ARG_LINKOSI "pic")
endif()
target_link_libraries(${PARSED_ARG_NAME} osi::${PARSED_ARG_LINKOSI})
endif()
target_compile_options(${PARSED_ARG_NAME} PRIVATE
......@@ -306,12 +316,13 @@ function(add_openpass_target)
if(DEFINED PARSED_ARG_LIBRARIES)
list(APPEND DEPS ${PARSED_ARG_LIBRARIES})
endif()
if(${PARSED_ARG_LINKOSI})
list(APPEND DEPS "${OSI_LIBRARIES}" protobuf::libprotobuf)
if(DEFINED PARSED_ARG_LINKOSI)
list(APPEND DEPS osi::${PARSED_ARG_LINKOSI} protobuf::libprotobuf)
endif()
message(DEBUG "Locating shared library test dependencies...")
message(DEBUG "Locating shared library test dependencies for ${PARSED_ARG_NAME}")
foreach(DEP IN LISTS DEPS)
message(DEBUG "Locating ${DEP}...")
if(TARGET ${DEP})
set(DEP_PATH "")
message(DEBUG "Target dependency: ${DEP}")
......@@ -387,7 +398,15 @@ function(add_openpass_target)
list(APPEND DEP_PATHS "${DEP_PATH}")
endforeach()
list(REMOVE_DUPLICATES DEP_PATHS)
if(WIN32)
# try to move MSYS system folder to the end of the list
set(DEP_PATHS_NO_MSYS ${DEP_PATHS})
list(FILTER DEP_PATHS EXCLUDE REGEX "msys")
list(FILTER DEP_PATHS_MSYS INCLUDE REGEX "msys")
list(APPEND DEP_PATHS ${DEP_PATHS_MSYS})
list(JOIN DEP_PATHS "\\;" ADDITIONAL_PATHS)
set(CURRENT_PATH "$ENV{PATH}")
string(REGEX REPLACE "\;" "\\\;" CURRENT_PATH "${CURRENT_PATH}")
......
......@@ -79,7 +79,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(WITH_SIMCORE OR WITH_TESTS)
find_package(Protobuf REQUIRED)
add_compile_definitions(PROTOBUF_USE_DLLS)
find_package(OSI REQUIRED)
......
################################################################################
# Copyright (c) 2020-2021 in-tech GmbH
# 2022 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
......@@ -32,26 +33,26 @@ foreach(SEARCH_DIR IN LISTS SEARCH_DIRS)
message(STATUS "processing ${SEARCH_DIR}")
if(WIN32 AND NOT MSVC)
# CMake uses OS API calls to spawn processes using `execute_process()`.
# Even if MSYS is the first entry in PATH, a potentially available `bash` from a WSL installation will be found first.
# Thus, the environment variable SHELL is read here, which will have an absolute path if it is set.
# Otherwiswe, the fallback to hardcoded `bash` will at least work on systems without WSL setup.
if(DEFINED ENV{SHELL})
set(SHELL $ENV{SHELL})
else()
set(SHELL bash)
endif()
# CMake uses OS API calls to spawn processes using `execute_process()`.
# Even if MSYS is the first entry in PATH, a potentially available `bash` from a WSL installation will be found first.
# Thus, the environment variable SHELL is read here, which will have an absolute path if it is set.
# Otherwiswe, the fallback to hardcoded `sh` will at least work on systems without WSL setup (and Linux).
if(DEFINED ENV{SHELL})
set(SHELL $ENV{SHELL})
else()
set(SHELL sh)
endif()
if(WIN32 AND NOT MSVC)
execute_process (
WORKING_DIRECTORY ${SEARCH_DIR}
COMMAND ${SHELL} -c "for f in \$(find -iname \'*.dll\'); do cygpath -a -m \$(dirname \$f); done | sort -u"
COMMAND "${SHELL}" "-c" "for f in \$(find -iname \'*.dll\'); do cygpath -a -m \$(dirname \$f); done | sort -u"
OUTPUT_VARIABLE DETECTED_LIBRARY_DIRS
)
else()
execute_process (
WORKING_DIRECTORY ${SEARCH_DIR}
COMMAND $ENV{SHELL} -lc "for f in \$(find -iname \'*.so\'); do realpath \$(dirname \$f); done | sort -u"
COMMAND "${SHELL}" "-c" "for f in \$(find -iname \'*.so\'); do realpath \$(dirname \$f); done | sort -u"
OUTPUT_VARIABLE DETECTED_LIBRARY_DIRS
)
endif()
......@@ -104,10 +105,3 @@ install(CODE
"
)
# install schema files into install directory
file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/schemas/ SCHEMA_SRC)
file(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/schemas/ SCHEMA_DEST)
install(DIRECTORY ${SCHEMA_SRC}
DESTINATION ${SCHEMA_DEST})
message("schemas installed from ${SCHEMA_SRC} to ${SCHEMA_DEST}")
################################################################################
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# SPDX-License-Identifier: EPL-2.0
################################################################################
#-----------------------------------------------------------------------------
# \file openPASS.pri
# \brief This file includes the paths to all the interfaces needed
# for the Project Interface
#
#
# Copyright (c) 2017 Volkswagen Group of America.
# Copyright (c) 2021 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#-----------------------------------------------------------------------------/
################################################################################
include(../../../application/Interfaces/openPASS/openPASS.pri)
include(../../project/Interfaces/openPASS-Project/openPASS-Project.pri)
include(../../window/Interfaces/openPASS-Window/openPASS-Window.pri)
# sets install command to copy xml Schema files from repository to installation directory
install(DIRECTORY ${CMAKE_SOURCE_DIR}/schemas DESTINATION .)
message("-- xml schema file will be installed in the schema folder of the installation directory")
\ No newline at end of file
......@@ -22,11 +22,13 @@ if(WITH_DOC)
-M html # generate HTML
${CMAKE_BINARY_DIR}/doc/source # source path
${CMAKE_BINARY_DIR}/doc # destination path
-DWITH_API_DOC=${WITH_API_DOC} # turn exhale ON/OFF
-D api_doc_build=${WITH_API_DOC} # turn exhale ON/OFF
-W --keep-going # treat warnings as errors but keep-going
-n # https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-nitpicky
COMMENT "Build Sphinx documentation"
COMMAND ${CMAKE_COMMAND}
-E cmake_echo_color --green
"The HTML pages are in ${CMAKE_BINARY_DIR}/doc/html.")
"The HTML pages are in ${CMAKE_BINARY_DIR}/doc/html/index.html")
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
${CMAKE_BINARY_DIR}/doc)
......
......@@ -24,14 +24,54 @@ Sphinx
- [OSI Sphinx Config](https://github.com/OpenSimulationInterface/osi-documentation/blob/master/conf.py)
## Building the documentation
## Building the documentation (Windows)
1. Get MSYS2 from https://www.msys2.org/
2. Start MSYS2 MSYS and update the system packages:
```
pacman -Syuu
```
If the upgrade requires a restart of MSYS2, resume the upgrade by re-opening the shell and call:
```
pacman -Suu
```
3. Install required packages: Start MSYS2 MinGW 64bit and execute
```
pacman -S mingw-w64-x86_64-cmake #Tested with 3.19.2-1
pacman -S make #Tested with 4.3-1
pacman -S mingw-w64-x86_64-gcc #Tested with 10.2.0-6
pacman -S mingw-w64-x86_64-python-sphinx
pacman -S mingw-w64-x86_64-python-pip #Tested with 21.1.3-2
pacman -S mingw-w64-x86_64-python-lxml #Tested with 4.6.2-2
wget -P /mingw64/share/texmf-dist/tex/latex/anyfontsize http://mirrors.ctan.org/macros/latex/contrib/anyfontsize/anyfontsize.sty
pacman -S mingw-w64-x86_64-zziplib #Tested with 0.13.72-3
pacman -S mingw-w64-x86_64-texlive-bin #Tested with 2021.20210424-5
pacman -S mingw-w64-x86_64-texlive-core #Tested with 2021.20210519-2
pacman -S mingw-w64-x86_64-texlive-font-utils #Tested with 2021.20210519-1
pip3 install sphinx-rtd-theme sphinx-tabs
```
4. Create a directory named `build` inside your checked out repository and navigate to it in the MSYS2 MinGW 64bit shell
5. Execute
```
cmake -G "MSYS Makefiles" -DWITH_DOC=ON -DWITH_SIMCORE=OFF -DWITH_TESTS=OFF ..
make doc
```
## Building the documentation (Debian)
```
# install python, pip, spellchecker, ...
sudo apt install doxygen python3 python3-pip dvipng
# install sphinx and its extensions
pip3 install sphinx sphinx-rtd-theme sphinx-tabs breathe exhale sphinxcontrib-spelling
pip3 install sphinx sphinx-rtd-theme sphinx-tabs
# build doc (only)
mkdir build
......
###############################################################################
# Copyright (c) 2021 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
###############################################################################
import os
import shutil
from textwrap import dedent
from sphinx.directives.other import TocTree
class ARGS:
"""Default argument values"""
API_DOC_BUILD_DEACTIVATED = "off"
DEFAULT_API_DOC_BUILD = API_DOC_BUILD_DEACTIVATED
DEFAULT_API_DOC_PATH = "api"
DEFAULT_API_DOC_TITLE = "Source Code Documentation"
def api_doc_build_activated(config):
"""True if api_doc_build is NOT set to deactivated"""
return config.api_doc_build.lower() != ARGS.API_DOC_BUILD_DEACTIVATED
def purge_api_doc_path(app, config):
"""Purges the rst files from the build folder"""
api_doc_path = os.path.join(app.srcdir, config.api_doc_path)
if os.path.exists(api_doc_path):
shutil.rmtree(api_doc_path, ignore_errors=True)
def on_config_inited(app, config):
"""
Sphinx Event Hook:
Activates and configures breath and exhale if api_doc_build is active
"""
if api_doc_build_activated(config):
app.setup_extension('breathe')
app.setup_extension('exhale')