Doxygen won't find headers in subdir - c++

I'm documenting a C++ library's header files with Doxygen. In the Doxyfile, I defined
INPUT = include/
in the hopes that Doxygen would then generate documentation for all the header files in include/Foo, but it doesn't: only the index.html is generated. I can set INPUT to include/Foo, but then the documentation lists the headers with their basenames (Reader.hh), while I want clients to include the headers as Foo/Reader.hh etc.
How can I get Doxygen to look within the subdirectory?

Have you set RECURSIVE to YES?
# 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
it's in the Doxyfile (here line 608, might be sligthly different for you)

Related

How can I get doxygen to document a template class defined in .tcc file?

I have used Code::Blocks to create a C++ project. I have three project files: A .hxx file which contains the declaration of a class template; a .tcc file in which the member functions of the class template are defined and documented; and a .cxx file which contains a program that tests an instance of the class. I have used the doxygen interface in Code::Blocks to document all the files. However, when I use the doxygen interface generate the documentation for the project, the doxygen-generated documentation does not include both the implementation code and the documentation in the .tcc file.
Does somebody know what I should do to have doxygen generate the documentation in the .tcc file? Any help with regard to the solution of this problem would be appreciated highly.
From a standard Doxyfile
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = path/to/src/dir
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
# *.h) to filter out the source-files in the directories.
#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# read by doxygen.
#
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
FILE_PATTERNS = *.tcc *.cxx *.hxx
also see:
Doxygen input file documentation
Doxygen file pattern documentation

Why doesn't Xcode6 see included header files

I'm trying to build opencv2 as a universal framework. I am systematically removing the files/folders that I do not need. But I am running into this issue where the include files are not found. See the image below:
The following image clearly shows that the file is indeed there.
One of the contractors working with us said he had put the include files into the same directory as the source files and rename them according to their file structure but using "." instead of "/" as shown below:
But that means that I must go through all of the files that include files and change the include statement to use "." instead of "/". REALLY?
Is this true? Or do we have a configuration set wrong?
You need to setup search paths for your target in Build Settings->Search Paths->Header search paths.

Generating documentation with doxygen

I would like to generate documentation for C++ files with doxygen. Everything is good when all the *.h and *.cpp files are stored in one folder. Then I type
doxygen -g doxygenfile
and then
doxygen doxygenfile
After all this I have a latex folder and an html folder. Everything is good. The problem is when these files *.h *.cpp are stored in different locations, e.g.: *.h in H folder *.cpp in CPP folder and so on. Could somebody tell me how to generate the documentation in this case?
If you want a GUI to tweak how Doxygen works you can use doxywizard and open the generate Doxyfile.
In order to make doxygen look into the subdirectories you can change in the Doxyfile this line
RECURSIVE =
with
RECURSIVE = YES
Edit: As bornruffians pointed out, Doxygen looks for the source files in the directories specified in the INPUT setting (always in the Doxyfile). So you can specify each directory in the INPUT tag by writing something like
INPUT = "src/CPP" "src/H"
and turn off the RECURSIVE tag. You can also put single files as values for the INPUT tag.

How do I get Doxygen to expand macros from include files?

I have a number of multiline macros defined in a file called macros.h. In my doxyfile, I've got
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = NO
yet Doxygen still will not expand the macros in any source file that includes macros.h. I ran "doxygen -d Preprocessor doxyfile" to see the output of the preprocessor, and it outputs messages like:
#include macros.h: not found or already included! skipping...
You've told your compiler about your include path, but you haven't told doxygen. So it tries to open "macros.h" and gets a file-not-found error.
You need to properly set INCLUDE_PATH in your Doxyfile.
#Ben: Have you actually gotten INCLUDE_PATH to work?
I understand the theory. I have set up the INCLUDE_PATH as explained (in both absolute and relative forms) but to no avail. I have set INCLUDE_FILE_PATTERNS to *.h. Nonetheless, when processing my .cpp files Doxygen finds all of the headers in the INPUT directory yet fails to find any headers in my lib/ subdirectory.
The only solutions I have found are:
1) Create a symbolic link within the INPUT directory to each header in its lib/ subdirectory. This is ugly and ungeneralizable.
2) Set the RECURSIVE tag to YES. This is undesirable because now the entire contents INPUT's tests/ subdirectory get added to the generated documentation.
I am inclined to believe that INCLUDE_PATH functionality is simply broken (at least in version 1.7.1 that I am running).

Renaming File Paths and Doxygen

I have a file that is located at a different path at development time, however at the time of release it will be in a different location. The title of the documentation, after being generated, is set to the development path. Is it possible to manually set the path of the filename?
What I mean about title:
The structure of the documented source file is:
\File\Path\Filename.cpp [Title]
Function prototypes
… (other documented aspects)
For example the file is located at c:\Code\Dev\Filename.cpp during development and during release it is located at c:\SuperFantasticApplication\Code\Filename.cpp.
I’ve tried adding a parameter after the filename at the top of the file (\file [name I want it to be]). However, that does not work.
There's an option in doxygen to turn of using full path names in the documentation. Inside your doxygen configuration file set FULL_PATH_NAMES to NO.
Here's what the documentation says about it:
If the FULL_PATH_NAMES tag is set to
YES doxygen will prepend the full
path before files name in the file
list and in the header files. If set
to NO the shortest path that makes the
file name unique will be used