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 61 62 63 64 65 66 67 68 69 70 71 72
|
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
CMAKE_MINIMUM_REQUIRED(VERSION 3.13)
FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND)
FIND_FILE(PLANTUML_JAR
NAMES plantuml.jar
HINTS ENV{PLANTUML_JAR_PATH}
PATHS
/usr/global/share/java/plantuml/
/usr/local/share/java/plantuml/
/usr/share/java/
/usr/local/share/java/
/usr/share/plantuml/)
IF(PLANTUML_JAR)
SET(DOXYGEN_PLANTUML_JAR_FILE ${PLANTUML_JAR})
ELSE()
SET(DOXYGEN_PLANTUML_JAR_FILE "")
MESSAGE(
NOTICE
"Did not find plantuml.jar -- Will not generate class diagrams.")
ENDIF(PLANTUML_JAR)
IF(config_DOXYGEN_CRITICAL)
SET(DOXYGEN_WARN_AS_ERROR "YES")
ELSE(config_DOXYGEN_CRITICAL)
SET(DOXYGEN_WARN_AS_ERROR "NO")
ENDIF(config_DOXYGEN_CRITICAL)
# set input and output files
SET(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
SET(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
# request to configure the file
CONFIGURE_FILE(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
MESSAGE(NOTICE "Doxygen available, adding 'doc' target.")
ADD_CUSTOM_TARGET(
doc
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
DEPENDS ${DOXYGEN_OUT} ${PROJECT_BINARY_DIR}/etc/RootMenuDebian.plist
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen."
VERBATIM)
FILE(
COPY ${PROJECT_SOURCE_DIR}/tests/data/toolkit/primitive_close_icon.png
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/html)
FILE(
COPY ${PROJECT_SOURCE_DIR}/tests/data/toolkit/primitive_minimize_icon.png
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/html)
FILE(
COPY ${PROJECT_SOURCE_DIR}/share/wlmaker.svg
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/html)
ELSE()
MESSAGE(NOTICE "Doxygen not found. Not adding 'doc' target to generate API documentation.")
ENDIF(DOXYGEN_FOUND)
|