From ee4c3fd91eea9a80d0ef891182432a2edfb02221 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Sun, 8 Sep 2019 18:13:29 +0200 Subject: ECMAddQch: add INCLUDE_DIRS argument Summary: Allows to have headers be found by doxygen, e.g. to properly process preprocessor macros. Reviewers: #build_system, dfaure Reviewed By: dfaure Subscribers: dfaure, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D23791 --- modules/ECMAddQch.cmake | 14 +++++++++++++- modules/ECMQchDoxygen.config.in | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/ECMAddQch.cmake b/modules/ECMAddQch.cmake index 60230eac..88b84783 100644 --- a/modules/ECMAddQch.cmake +++ b/modules/ECMAddQch.cmake @@ -20,6 +20,7 @@ # [SOURCE_DIRS [ [...]]] # [SOURCES [ [...]]] # |MD_MAINPAGE ] +# [INCLUDE_DIRS [ [...]]] # [IMAGE_DIRS [ [...]]] # [EXAMPLE_DIRS [ [...]]] # [ORG_DOMAIN ] @@ -79,6 +80,9 @@ # page. This page will overrule any ``\mainpage`` command in the included # sources. # +# INCLUDE_DIRS specifies the dirs which should be searched for included +# headers. Dirs can be relative to the current source dir. Since 5.63. +# # IMAGE_DIRS specifies the dirs which contain images that are included in the # documentation. Dirs can be relative to the current source dir. # @@ -403,7 +407,7 @@ function(ecm_add_qch target_name) # Parse arguments set(options VERBOSE) set(oneValueArgs NAME BASE_NAME QCH_INSTALL_DESTINATION TAGFILE_INSTALL_DESTINATION COMPONENT VERSION NAMESPACE MD_MAINPAGE ORG_DOMAIN CONFIG_TEMPLATE) - set(multiValueArgs SOURCE_DIRS SOURCES IMAGE_DIRS EXAMPLE_DIRS PREDEFINED_MACROS BLANK_MACROS LINK_QCHS) + set(multiValueArgs SOURCE_DIRS SOURCES INCLUDE_DIRS IMAGE_DIRS EXAMPLE_DIRS PREDEFINED_MACROS BLANK_MACROS LINK_QCHS) cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) # check required args @@ -487,6 +491,14 @@ function(ecm_add_qch target_name) set(ECM_QCH_DOXYGEN_OUTPUTDIR "\"${_apidox_builddir}\"") set(ECM_QCH_DOXYGEN_TAGFILE "\"${_tags_buildpath}\"") set(ECM_QCH_DOXYGEN_LAYOUTFILE "\"${_doxygen_layout_file}\"") + set(ECM_QCH_DOXYGEN_INCLUDE_PATH) + foreach(_include_DIR IN LISTS ARGS_INCLUDE_DIRS) + if (NOT IS_ABSOLUTE ${_include_DIR}) + set(_include_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${_include_DIR}") + endif() + # concat dirs separated by a break, it is no issue that first has also a leading break + set(ECM_QCH_DOXYGEN_INCLUDE_PATH "${ECM_QCH_DOXYGEN_INCLUDE_PATH} \\\n\"${_include_DIR}\"") + endforeach() set(ECM_QCH_DOXYGEN_IMAGEDIRS) foreach(_image_DIR IN LISTS ARGS_IMAGE_DIRS) if (NOT IS_ABSOLUTE ${_image_DIR}) diff --git a/modules/ECMQchDoxygen.config.in b/modules/ECMQchDoxygen.config.in index 58d53b14..026111af 100644 --- a/modules/ECMQchDoxygen.config.in +++ b/modules/ECMQchDoxygen.config.in @@ -146,7 +146,7 @@ ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES -INCLUDE_PATH = +INCLUDE_PATH = @ECM_QCH_DOXYGEN_INCLUDE_PATH@ INCLUDE_FILE_PATTERNS = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES -- cgit v1.2.1