Doxygen includes call graph but excludes module files from documentation index
I am trying to prepare doxygen documentation with call + caller charts included, but excluding the source modules from the output documentation. I don't want the two files to doxytest.h
both doxytest.c
duplicate some functions and display private functions in the documentation.
I understand that doxygen has to process the source modules as input in order to generate call + caller plots. This is fine, but I haven't found a way to enable this functionality by excluding the original modules from doc-build.
Problem
- generate call + callle graphs for functions from api (
*.h
)- exclude source modules (
*.c
) from documentation
I created the following doxytest project with three files that has this problem:
project structure
doxytest
|-----doxygen.config
|-----doxytest.h
|-----doxytest.c
|-----html
doxygen.config
PROJECT_NAME = "doxytest"
OUTPUT_DIRECTORY = ./
OPTIMIZE_OUTPUT_FOR_C = YES
TYPEDEF_HIDES_STRUCT = YES
HIDE_SCOPE_NAMES = YES
SHOW_NAMESPACES = NO
INPUT = ./
FILE_PATTERNS = *.h *.c
GENERATE_HTML = YES
GENERATE_LATEX = NO
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH = ./
INCLUDE_FILE_PATTERNS = *.h
PREDEFINED =
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
HAVE_DOT = YES
SOURCE_BROWSER = NO
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO
CALL_GRAPH = YES
CALLER_GRAPH = YES
DIRECTORY_GRAPH = NO
COLLABORATION_GRAPH = NO
DISABLE_INDEX = YES
GENERATE_TREEVIEW = YES
doxytest.h
#ifndef __doxytest__
#define __doxytest__
/*! @file
*/
void callee();
void middleman();
void caller();
#endif __doxytest__
doxytest.c
#include <doxytest.h>
#include <stdio.h>
void callee()
{
;
}
void middleman()
{
callee();
}
void caller()
{
middleman();
}
current behavior
This config prints the output using the call + callle diagram, but also includes documentation doxytest.c
in the output (screenshot1)
If I remove *.c
from FILE_PATTERNS by changing this line to:
FILE_PATTERNS = *.h
Then this removes the output from the documentation *.c
, but also the call + callee .. diagrams (screenshot2)
How can I fix it?
khaki
As a (very dodgy) workaround, I am currently running two doxygen sessions and merging the graphical documentation into an api index:
.PHONY:docs
docs:
doxygen doxygen.pass1.cfg;
mv html htmlpass1;
doxygen doxygen.pass2.cfg;
ls `cat doxygen.pass2.cfg | grep '^INPUT' | cut -d '=' -f2` | grep '\.h$$' | sed 's/\.h$$/_8h\*/g' | sed 's/^/rm -f .\/html\//g' 1>graph_api_docs;
ls `cat doxygen.pass2.cfg | grep '^INPUT' | cut -d '=' -f2` | grep '\.h$$' | sed 's/\.h$$/_8h\*/g' | sed 's/^/cp .\/htmlpass1\//g' | sed 's/$$/ .\/html\//g' 1>>graph_api_docs;
/bin/bash graph_api_docs;
rm -rf htmlpass1 graph_api_docs;
.PHONY:clean
clean:
rm -rf ./html;
We are looking for the right solution to this problem.
source to share
No one has answered this question yet
Check out similar questions: