forked from opensim-org/opensim-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ApiDoxygen.cmake
60 lines (51 loc) · 2.55 KB
/
ApiDoxygen.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
INCLUDE(FindDoxygen)
IF(DOXYGEN_EXECUTABLE-NOTFOUND)
ELSE(DOXYGEN_EXECUTABLE-NOTFOUND)
SET(DOXY_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
# Configure linking to Simbody documentation.
# Some of these variables are used in Doxyfile.in.
# This variable must be a STRING; a PATH variable resolves //'s as a single
# /, but we need to use double slashes for URL's.
SET(OPENSIM_SIMBODY_DOXYGEN_LOCATION "${Simbody_DOXYGEN_DIR}"
CACHE STRING
"The location of Simbody's doxygen documentation. By default, OpenSim's
Doxygen will link to the user's *local* Simbody documentation. However,
when the OpenSim documentation is put online, there is no local Simbody
Doxygen documentation. In this case, this variable can be set to a URL
where one can find Simbody Doxygen documentation online. Delete from
CMakeCache.txt to reset to default.")
MARK_AS_ADVANCED(OPENSIM_SIMBODY_DOXYGEN_LOCATION)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${DOXY_CONFIG}
@ONLY )
# The goal here is to run Doxygen to generate most of the API documentation
# under "html" in the binary directory, then apply a few hand-tweaked
# hacks to it there.
# The result should be fully-functional documentation in the binary
# directory (start with index.html) that can be examined while debugging
# Doxygen comments. Then when we do an INSTALL later (see below), we just
# need to copy over the binary html directory into sdk/doc.
# (sherm 20120127)
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/html/")
###############
# RUN DOXYGEN #
###############
# Doxfile.in should take care of directing the output of Doxygen
# to ${PROJECT_BINARY_DIR}/html. Note that you have to invoke this
# "doxygen" target directly; it isn't run by default.
ADD_CUSTOM_TARGET(doxygen ${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG})
# There is an "images" directory containing the pictures needed by
# the main page Copy all the files into html/images.
ADD_CUSTOM_COMMAND(TARGET doxygen POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_CURRENT_SOURCE_DIR}/OpenSim/doc/images"
"${PROJECT_BINARY_DIR}/html/images/")
################
# INSTALLATION #
################
INSTALL(DIRECTORY "${PROJECT_BINARY_DIR}/html/"
DESTINATION "sdk/doc/html"
)
# This is just a shortcut to the Doxygen index.html.
INSTALL(FILES "OpenSimAPI.html" DESTINATION "sdk/doc")
ENDIF(DOXYGEN_EXECUTABLE-NOTFOUND)