¿Cómo hacer que el preprocesador doxygen recurra a subdirectorios?

4 minutos de lectura

Avatar de usuario de Jakob S.
jakob s.

No consigo que el preprocesador doxygen incluya archivos recursivamente. ¿Como hacer esto?

Hice un ejemplo que consta de dos encabezados y un archivo Doxygen:

subdir/example.h
subdir2/example_include.h
Doxygen

Este es el listado de example.h:

#include "example_include.h"

typedef struct
{
    float   array[ARRAY_LENGTH * 2 - 1];
#if CONDITION == MY_FALSE
    char        optional_char;
#endif
} ExampleType;

Este es el listado de example_include.h:

#define MY_FALSE            (0u)
#define MY_TRUE             (1u)
#define CONDITION       MY_TRUE
#define ARRAY_LENGTH    (20u)

Mis cambios con respecto al archivo de configuración predeterminado de Doxygen (usando Doxygen 1.8.2) son:

INPUT                  = .
RECURSIVE              = YES
GENERATE_XML           = YES
MACRO_EXPANSION        = YES
INCLUDE_PATH           = .

El XML de salida de Doxygen para ExampleType (archivo: xml/struct_example_type.xml) es:

<?xml version='1.0' encoding='UTF-8' standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.2">
  <compounddef id="struct_example_type" kind="struct" prot="public">
    <compoundname>ExampleType</compoundname>
      <sectiondef kind="public-attrib">
      <memberdef kind="variable" id="struct_example_type_1aa7b8f391fc62f93c34c2b305542db339" prot="public" static="no" mutable="no">
        <type>float</type>
        <definition>float ExampleType::array[ARRAY_LENGTH *2-1]</definition>
        <argsstring>[ARRAY_LENGTH *2-1]</argsstring>
        <name>array</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" line="5" bodyfile="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" bodystart="5" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="struct_example_type_1a8428371f21c1fb8fd28cb1062c7b1152" prot="public" static="no" mutable="no">
        <type>char</type>
        <definition>char ExampleType::optional_char</definition>
        <argsstring></argsstring>
        <name>optional_char</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" line="7" bodyfile="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" bodystart="7" bodyend="-1"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <location file="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" line="4" bodyfile="D:/Sandboxes/ALN_Alignment_SRR295/04_Engineering/01_Source_Code/algo/exmaple/subdir/example.h" bodystart="3" bodyend="9"/>
    <listofallmembers>
      <member refid="struct_example_type_1aa7b8f391fc62f93c34c2b305542db339" prot="public" virt="non-virtual"><scope>ExampleType</scope><name>array</name></member>
      <member refid="struct_example_type_1a8428371f21c1fb8fd28cb1062c7b1152" prot="public" virt="non-virtual"><scope>ExampleType</scope><name>optional_char</name></member>
    </listofallmembers>
  </compounddef>
</doxygen>

En realidad, esperaría ARRAY_LENGTH para ser reemplazado por (20u) y optional_char no debe ser miembro de la estructura.

Parece que mi pregunta está relacionada con esto, sin embargo, la única respuesta prometedora es el comentario de @Phineas que dice que fue un problema que se solucionó en la versión 1.7.4 de doxygen. Sin embargo, sigo viendo el mismo comportamiento. ¿Qué hacer con esto?

Por cierto, el “caso de uso” es simple: es un proyecto de estudio visual. El compilador incluye todos los archivos que desee, ya que todos están contenidos en la definición del proyecto.

Avatar de usuario de Geremia
Geremia

¿Ha establecido RECURSIVO en SÍ?

# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.

RECURSIVE              = YES

está en el Doxyfile

fuente

Y para que quede claro, el valor predeterminado es NO.

  • Sí. Documenté mis cambios en el Doxyfile en mi pregunta, y “RECURSIVO = SÍ” es uno de ellos.

    – Jacob S.

    29 de junio de 2016 a las 18:38

¿Ha sido útil esta solución?