mirror of
https://gitee.com/openharmony/arkcompiler_runtime_core
synced 2024-11-27 00:41:14 +00:00
c658ccf319
Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/I5G96F Test: Test262 suit, ark unittest, rk3568 XTS, ark previewer demo Signed-off-by: huangyu <huangyu76@huawei.com> Change-Id: I3f63d129a07deaa27a390f556dcaa5651c098185
61 lines
1.9 KiB
CMake
61 lines
1.9 KiB
CMake
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
|
# 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
|
|
#
|
|
# http://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.
|
|
# Convenience functions for autogenerate documentation.
|
|
option(ENABLE_DOXYGEN "Enable documentation generation" false)
|
|
|
|
add_custom_target(doc_build COMMENT "Building doxygen documentation")
|
|
|
|
# Example usage:
|
|
#
|
|
# add_doxygen(
|
|
# NAME "project_name"
|
|
# PATH "${ROOT_PROJECT_PATH}"
|
|
# )
|
|
#
|
|
# Notes:
|
|
# * This function is a no-op if Doxygen is not found.
|
|
#
|
|
|
|
function(add_doxygen)
|
|
set(prefix ARG)
|
|
set(noValues)
|
|
set(singleValues NAME)
|
|
|
|
find_package(Doxygen)
|
|
|
|
if ((NOT ENABLE_DOXYGEN) OR (NOT DOXYGEN_FOUND))
|
|
return()
|
|
endif()
|
|
|
|
set(DOXYGEN_CONFIG_TEMPLATE "${PANDA_ROOT}/docs/doxygen.config")
|
|
|
|
cmake_parse_arguments(${prefix}
|
|
"${noValues}"
|
|
"${singleValues}"
|
|
"${multiValues}"
|
|
${ARGN})
|
|
|
|
set(DOXYGEN_CONF_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
|
|
|
# Configuration - replace @CMAKE_MACRO@ definition in config template
|
|
CONFIGURE_FILE(${DOXYGEN_CONFIG_TEMPLATE} ${DOXYGEN_CONF_OUT})
|
|
|
|
add_custom_target( doc_${ARG_NAME}
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONF_OUT}
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
COMMENT "Generating API documentation with Doxygen"
|
|
VERBATIM )
|
|
|
|
add_dependencies(doc_build doc_${ARG_NAME})
|
|
endfunction()
|