diff options
| author | Friedrich W. H. Kossebau <kossebau@kde.org> | 2019-09-08 18:13:29 +0200 | 
|---|---|---|
| committer | Friedrich W. H. Kossebau <kossebau@kde.org> | 2019-09-15 01:53:21 +0200 | 
| commit | ee4c3fd91eea9a80d0ef891182432a2edfb02221 (patch) | |
| tree | 7f0ea8096c6237bec09ab358a3164a881fb1652e | |
| parent | 95a825fae3733205be91d60fed6f9aa4be11d089 (diff) | |
| download | extra-cmake-modules-ee4c3fd91eea9a80d0ef891182432a2edfb02221.tar.gz extra-cmake-modules-ee4c3fd91eea9a80d0ef891182432a2edfb02221.tar.bz2 | |
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
| -rw-r--r-- | modules/ECMAddQch.cmake | 14 | ||||
| -rw-r--r-- | 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 <dir> [<dir2> [...]]]  #       [SOURCES <file> [<file2> [...]]]  #       |MD_MAINPAGE <md_file>] +#       [INCLUDE_DIRS <incdir> [<incdir2> [...]]]  #       [IMAGE_DIRS <idir> [<idir2> [...]]]  #       [EXAMPLE_DIRS <edir> [<edir2> [...]]]  #       [ORG_DOMAIN <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 | 
