saschazelzer / CMakeDoxygenFilter

A Doxygen input filter for CMake scripts
12 stars 5 forks source link

Cannot use doxygen @param #1

Open GregAujay opened 12 years ago

GregAujay commented 12 years ago

Hello,

if I try to use the \param command, doxygen (tested with 1.8.1.2) tells me the param is not in the param list of the function or macro. The reason is that there is no parameter type and so the parameter name is understood as its type.

I fixed that adding the dumb keyword param in front of each parameter.

    _os << funcName << '(';
    if (nextToken() == CMakeLexer::TOK_IDENTIFIER)
    {
      _os << "param " << _lexer.getIdentifier();
      while (nextToken() == CMakeLexer::TOK_IDENTIFIER)
      {
        _os << ", param " << _lexer.getIdentifier();
      }
    }

Is there a simpler way of doing this ?

saschazelzer commented 12 years ago

Hi,

I have been annoyed by these warnings too but refrained from adding an artificial type like you suggested. The reason is that the signature for the CMake macro/function call as generated by Doxygen will be misleading. I would like to see this fixed, but cannot see a satisfying solution yet.

GregAujay commented 12 years ago

I saw this documentation: http://www.rad.upenn.edu/sbia/software/basis/apidoc/latest/group__CMakeAPI.html#gaced9a5e1170a437f4cb9dfe3290eec30

They seem to use a doxygen filter in python: http://www.rad.upenn.edu/sbia/software/basis/apidoc/latest/doxyfilter-cmake_8py_source.html

I think that they use python syntax to document things, as there are no type in the function definitions its ok.

I'll try to modify your code to find something satisfying.

GregAujay commented 12 years ago

Again, false alarm. They just use C / C++ documentation style but add the "in" keyword in front of every parameter. It is not a good solution since some of my function actually use "out" parameters.

I get something bad after modifying your filter to generate python style documentation and using: EXTENSION_MAPPING set to cmake=Python