File tree Expand file tree Collapse file tree 5 files changed +37
-736
lines changed Expand file tree Collapse file tree 5 files changed +37
-736
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,31 @@ target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY})
6767
6868
6969# add a target to generate API documentation with Doxygen
70+ # Dependencies: Doxygen and proto2cpp.py
7071FIND_PACKAGE (Doxygen)
72+ set (FILTER_PROTO2CPP_PY_PATH CACHE PATH "directory to the filter proto2cpp.py" )
7173
72- IF (DOXYGEN_FOUND)
73- set (doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR} /doxygen-config.cmake.in)
74- set (doxyfile ${CMAKE_CURRENT_BINARY_DIR} /Doxyfile)
74+ if (NOT DOXYGEN_FOUND)
7575
76- configure_file ( ${doxyfile_in} ${doxyfile} @ONLY )
76+ message (WARNING "Doxygen could not be found." )
7777
78- ADD_CUSTOM_TARGET (api_doc ALL
79- COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
80- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
81- ENDIF (DOXYGEN_FOUND)
78+ else ()
79+
80+ if (NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH} /proto2cpp.py)
81+
82+ message (WARNING "${FILTER_PROTO2CPP_PY_PATH} /proto2cpp.py could not be found." )
83+
84+ else ()
85+
86+ set (doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR} /doxygen-config.cmake.in)
87+ set (doxyfile ${CMAKE_CURRENT_BINARY_DIR} /Doxyfile)
88+
89+ configure_file (${doxyfile_in} ${doxyfile} @ONLY)
90+
91+ ADD_CUSTOM_TARGET (api_doc ALL
92+ COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
93+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
94+
95+ endif (NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH} /proto2cpp.py)
96+
97+ endif (NOT DOXYGEN_FOUND)
Original file line number Diff line number Diff line change @@ -76,3 +76,15 @@ Packaging
7676A specification to package sensor models using OSI as (extended)
7777Functional Mock-up Units (FMUs) for use in simulation environments
7878is available [ here] ( https://github.com/OpenSimulationInterface/osi-sensor-model-packaging ) .
79+
80+ Documentation
81+ -------------
82+
83+ In order to generate the doxygen documentation for OSI, please follow the following steps:
84+ 1 . Install Doxygen and set an environmental variable 'Doxygen' with the path to the binary file.
85+ 2 . Download and unzip the [ zip file containing the filter proto2cpp.py] ( https://sourceforge.net/projects/proto2cpp/files/latest/download ) .
86+ 3 . From the cmd navigate to the build directory and run:
87+ ``` cmd
88+ cmake -DFILTER_PROTO2CPP_PY_PATH=<path-to-proto2cpp.py> <path-to-CMakeLists.txt>
89+ ```
90+ 4 . The build process will then generate the doxygen documentation under the directory doc.
You can’t perform that action at this time.
0 commit comments