Skip to content

Commit b35a59d

Browse files
committed
Add support for building HTML docs with Doxygen v1.8 via CMake.
1 parent 3bbee55 commit b35a59d

13 files changed

+2635
-3559
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ option(IRR_BUILD_CEGUI "Enable CEGUI building and integration?" OFF)
180180

181181
option(IRR_BUILD_BULLET "Enable Bullet Physics building and integration?" OFF)
182182

183+
option(IRR_BUILD_DOCS "Enable building documentation?" ON)
184+
183185
set(THIRD_PARTY_SOURCE_DIR "${PROJECT_SOURCE_DIR}/3rdparty")
184186

185187
execute_process(COMMAND git submodule init
@@ -199,3 +201,7 @@ add_subdirectory(ext)
199201
if(IRR_BUILD_EXAMPLES)
200202
add_subdirectory(examples_tests)
201203
endif()
204+
205+
if(IRR_BUILD_DOCS)
206+
add_subdirectory(docs)
207+
endif()

docs/CMakeLists.txt

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2019 DevSH Graphics Programming Sp. z O.O.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
find_package(DOXYGEN)
17+
if(DOXYGEN_FOUND)
18+
# Set input and output files
19+
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
20+
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
21+
22+
# Request to configure the file
23+
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
24+
message("Doxygen build started")
25+
26+
# ALL allows the docs to be built together with the application
27+
add_custom_target(docs ALL
28+
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
29+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
30+
COMMENT "Generating API documentation"
31+
VERBATIM)
32+
else(DOXYGEN_FOUND)
33+
message("Doxygen needs to be installed to generate the documentation")
34+
endif(DOXYGEN_FOUND)

0 commit comments

Comments
 (0)