Skip to content

Commit

Permalink
Add OMSI documentation (#242)
Browse files Browse the repository at this point in the history
* added OMSI doxygen generation
* Renamed omsi -> OMSI and added target
  • Loading branch information
AnHeuermann authored and lochel committed Jun 17, 2019
1 parent 882f32b commit 915982a
Show file tree
Hide file tree
Showing 3 changed files with 2,443 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doc/Makefile
Expand Up @@ -13,6 +13,11 @@ usersguide:
@killall omc >/dev/null 2>&1 || true
BUILDDIR=openmodelica-doc_$(BUILDDIR_VER)

omsiruntime-doc:
mkdir -p SimulationRuntime/omsi/Images
cp images/logo.svg SimulationRuntime/OMSI/Images/OMLogo.svg
cd SimulationRuntime/OMSI && cmake -G "Unix Makefiles" -DSOURCE_ROOT=../../../OMCompiler/SimulationRuntime/OMSI && make Docs

cppruntime-doc:
mkdir -p SimulationRuntime/cpp/Images
cp images/logo.svg SimulationRuntime/cpp/Images/OMLogo.svg
Expand All @@ -27,7 +32,7 @@ cppruntime-doc-clean:
rm SimulationRuntime/cpp/Doc -rf
rm SimulationRuntime/cpp/Images/OMLogo.svg -f

docs-internal: generated_pdfs/dyOptInitialGuess.pdf generated_pdfs/cruntimedraft.pdf usersguide cppruntime-doc
docs-internal: generated_pdfs/dyOptInitialGuess.pdf generated_pdfs/cruntimedraft.pdf usersguide cppruntime-doc omsiruntime-doc
@test ! -z "$(BUILDDIR_VER)" || (echo Call docs, not docs-internal directly; false)
@test ! -z "$(BUILDDIR)"
rm -rf ./$(BUILDDIR)
Expand Down
50 changes: 50 additions & 0 deletions doc/SimulationRuntime/OMSI/CMakeLists.txt
@@ -0,0 +1,50 @@
# This script will build the doxygen based documentation for the omsi runtime
#
# The following variables are used to modify the configuration file of doxygen.
#
# TEMPLATE_ROOT_DIR the root folder for all html and css files that define the layout and style
# IMAGE_ROOT_DIR path to the root folder containing the images
# SOURCE_ROOT_DIR path to the folder of the simulation runtime code
# ADDITIONAL_DOC_ROOT_DIR path to the folder containing additional doxygen files
#
# The behaviour can be influenced by passing arguments to CMAKE
# if write output should be handled in parallel -DSOURCE_ROOT=PATH
# if ScoreP should be used for performance analysis -DTARGET_PATH=PATH
#

CMAKE_MINIMUM_REQUIRED (VERSION 2.8.6)
PROJECT(CppSolverInterface)
set(CMAKE_VERBOSE_MAKEFILE ON)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")

MESSAGE(STATUS "CMake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")

FIND_PACKAGE(Doxygen)

IF(NOT(SOURCE_ROOT))
MESSAGE(FATAL_ERROR "Please specify the root directory of the c++ sources.")
ENDIF(NOT(SOURCE_ROOT))
SET(SOURCE_ROOT_DIR ${SOURCE_ROOT})

IF(NOT(TARGET_PATH))
MESSAGE(STATUS "Target path was not set, so the current binary dir is used.")
SET(TARGET_PATH ${CMAKE_CURRENT_BINARY_DIR})
ENDIF(NOT(TARGET_PATH))

SET(TEMPLATE_ROOT_DIR "../../doxygen")
SET(IMAGE_ROOT_DIR "./Images")
SET(ADDITIONAL_DOC_ROOT_DIR "./")

if (NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen is needed to build the documentation. Please install it correctly")
endif()
MESSAGE(STATUS "Build the documentation with Doxygen")
#-- Configure the Template Doxyfile for our specific project
configure_file(OmsiRuntimeDoc.config.in
${PROJECT_BINARY_DIR}/OmsiRuntimeDoc.config @ONLY IMMEDIATE)
#-- Add a custom target to run Doxygen when ever the project is built
add_custom_target (Docs ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/OmsiRuntimeDoc.config
WORKING_DIRECTORY ${TARGET_PATH}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)

0 comments on commit 915982a

Please sign in to comment.