Skip to content

Commit

Permalink
Add support for C++20 modules
Browse files Browse the repository at this point in the history
  • Loading branch information
doxygen committed Aug 16, 2023
1 parent 473dcba commit 6d80fc7
Show file tree
Hide file tree
Showing 69 changed files with 4,132 additions and 519 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -11,7 +11,7 @@
# Documents produced by Doxygen are derivative works derived from the
# input used in their production; they are not affected by this license.

cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.12)
project(doxygen)

option(build_wizard "Build the GUI frontend for doxygen." OFF)
Expand Down Expand Up @@ -148,7 +148,7 @@ else ()
endif ()

find_program(DOT NAMES dot)
find_package(PythonInterp REQUIRED)
find_package(Python REQUIRED)
find_package(FLEX REQUIRED)
if (FLEX_VERSION VERSION_LESS 2.5.37)
message(SEND_ERROR "Doxygen requires at least flex version 2.5.37 (installed: ${FLEX_VERSION})")
Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Expand Up @@ -15,7 +15,7 @@ include (${TOP}/cmake/version.cmake)
string(TIMESTAMP DATE "%d-%m-%Y")
string(TIMESTAMP YEAR "%Y")

find_package(PythonInterp REQUIRED)
find_package(Python REQUIRED)
find_program(EPSTOPDF NAMES epstopdf )
find_program(PDFLATEX NAMES pdflatex )
find_program(MAKEINDEX NAMES makeindex )
Expand Down
14 changes: 11 additions & 3 deletions doc/commands.doc
Expand Up @@ -145,6 +145,7 @@ documentation:
\refitem cmdmaninclude \\maninclude
\refitem cmdmanonly \\manonly
\refitem cmdmemberof \\memberof
\refitem cmdmodule \\module
\refitem cmdmsc \\msc
\refitem cmdmscfile \\mscfile
\refitem cmdn \\n
Expand Down Expand Up @@ -509,9 +510,9 @@ Structural indicators

\addindex \\defgroup
Indicates that a comment block contains documentation for a
\ref modules "group" of classes, files or namespaces. This can be used to
categorize classes, files or namespaces, and document those
categories. You can also use groups as members of other groups,
\ref topics "topics" of classes, modules, concepts, files or namespaces. This can be used to
categorize symbols, and document those categories.
You can also use groups as members of other groups,
thus building a hierarchy of groups.

The \<name\> argument should be a single-word identifier.
Expand Down Expand Up @@ -917,6 +918,13 @@ Structural indicators
\ref cmdpublic "\\public", \ref cmdprotected "\\protected" and
\ref cmdprivate "\\private".

<hr>
\section cmdmodule \\module <name>

\addindex \\module
Indicates that a comment block contains documentation for a
C++20 module with name \<name\>.

<hr>
\section cmdname \\name [(header)]

Expand Down
2 changes: 1 addition & 1 deletion doc/doxygen_manual.tex
Expand Up @@ -205,7 +205,7 @@ \chapter{Resolving Typedef Example}\label{restypedef_example}\hypertarget{restyp
\subinputfrom{examples/diagrams/latex/}{refman_doc}
}{}

\chapter{Modules Example}\label{modules_example}\hypertarget{modules_example}{}
\chapter{Grouping Example}\label{modules_example}\hypertarget{grouping_example}{}
\subinputfrom{examples/group/latex/}{refman_doc}
\chapter{Member Groups Example}\label{memgrp_example}\hypertarget{memgrp_example}{}
\subinputfrom{examples/memgrp/latex/}{refman_doc}
Expand Down
140 changes: 70 additions & 70 deletions doc/grouping.doc
@@ -1,12 +1,12 @@
/******************************************************************************
*
*
*
*
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
Expand All @@ -16,49 +16,49 @@
*/
/*! \page grouping Grouping

Doxygen has three mechanisms to group things together.
Doxygen has three mechanisms to group things together.
One mechanism works at a global level, creating a new page
for each group. These groups are called \ref modules "'modules'" in the documentation.
for each group. These groups are called \ref topics "'topics'" in the documentation.
The second mechanism works within a member list of some compound entity,
and is referred to as a \ref memgroup "'member groups'".
For \ref cmdpage "pages" there is a third grouping mechanism referred to
and is referred to as a \ref memgroup "'member groups'".
For \ref cmdpage "pages" there is a third grouping mechanism referred to
as \ref subpaging "subpaging".

\section modules Modules
\section topics Topics

Modules are a way to group things together on a separate page. You
can document a group as a whole, as well as all individual members.
Members of a group can be files, namespaces, classes, functions,
Grouping is a way to group things together on a separate page, called a topic.
You can document a group as a whole, as well as all individual members.
Members of a group can be files, namespaces, classes, concepts, modules, functions,
variables, enums, typedefs, and defines, but also other groups.

To define a group, you should put the \ref cmddefgroup "\\defgroup"
command in a special comment block. The first argument of the command
is a label that should uniquely identify the group.
The second argument is the name or title of the group as it should appear
command in a special comment block. The first argument of the command
is a label that should uniquely identify the group.
The second argument is the name or title of the group as it should appear
in the documentation.

You can make an entity a member of a specific group by putting
You can make an entity a member of a specific group by putting
a \ref cmdingroup "\\ingroup" command inside its documentation block.

To avoid putting \ref cmdingroup "\\ingroup" commands in the documentation
for each member you can also group members together by the
open marker <code>\@{</code> before the group and the
closing marker <code>\@}</code> after the group. The markers can
be put in the documentation of the group definition or in a separate
documentation block.
for each member you can also group members together by the
open marker <code>\@{</code> before the group and the
closing marker <code>\@}</code> after the group. The markers can
be put in the documentation of the group definition or in a separate
documentation block.

Groups themselves can also be nested using these grouping markers.

You will get an error message when you use the same group label more than once.
If you don't want doxygen to enforce unique labels, then you can
If you don't want doxygen to enforce unique labels, then you can
use \ref cmdaddtogroup "\\addtogroup" instead of
\ref cmddefgroup "\\defgroup".
\ref cmddefgroup "\\defgroup".
It can be used exactly like \ref cmddefgroup "\\defgroup",
but when the group has been defined already, then it silently merges the
but when the group has been defined already, then it silently merges the
existing documentation with the new one.
The title of the group is optional for this command, so you can use
\verbatim
/** \addtogroup <label>
/** \addtogroup <label>
* @{
*/
...
Expand All @@ -69,19 +69,19 @@ to add additional members to a group that is defined in more detail elsewhere.

Note that compound entities (like classes, files and namespaces) can
be put into multiple groups, but members (like variable, functions, typedefs
and enums) can only be a member of one group
(this restriction is in place to avoid ambiguous linking targets in case
and enums) can only be a member of one group
(this restriction is in place to avoid ambiguous linking targets in case
a member is not documented in the context of its class, namespace
or file, but only visible as part of a group).

Doxygen will put members into the group whose definition has
the highest "priority": e.g. An explicit \ref cmdingroup "\\ingroup" overrides
an implicit grouping definition via <code>\@{</code> <code>\@}</code>.
Conflicting grouping definitions with the same priority trigger a warning,
unless one definition was for a member without any explicit documentation.
the highest "priority": e.g. An explicit \ref cmdingroup "\\ingroup" overrides
an implicit grouping definition via <code>\@{</code> <code>\@}</code>.
Conflicting grouping definitions with the same priority trigger a warning,
unless one definition was for a member without any explicit documentation.

The following example puts VarInA into group A and silently resolves
the conflict for IntegerVariable by putting it into group IntVariables,
The following example puts VarInA into group A and silently resolves
the conflict for IntegerVariable by putting it into group IntVariables,
because the second instance of IntegerVariable
is undocumented:

Expand Down Expand Up @@ -119,7 +119,7 @@ int IntegerVariable;

The \ref cmdref "\\ref" command can be used to refer to a group.
The first argument of the \\ref command should be group's label.
To use a custom link name, you can put the name of the links in
To use a custom link name, you can put the name of the links in
double quotes after the label, as shown by the following example
\verbatim
This is the \ref group_label "link" to this group.
Expand All @@ -138,64 +138,64 @@ in .c files without having to duplicate the hierarchy exactly.
\include group.cpp

\htmlonly
Click <a href="examples/group/html/modules.html">here</a>
Click <a href="examples/group/html/topics.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{modules_example}{Modules example}
See \hyperlink{grouping_example}{Grouping example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

\section memgroup Member Groups

If a compound (e.g. a class or file) has many members, it is often
desired to group them together. Doxygen already automatically groups
things together on type and protection level, but maybe you feel that
this is not enough or that that default grouping is wrong.
For instance, because you feel that members of different (syntactic)
If a compound (e.g. a class or file) has many members, it is often
desired to group them together. Doxygen already automatically groups
things together on type and protection level, but maybe you feel that
this is not enough or that that default grouping is wrong.
For instance, because you feel that members of different (syntactic)
types belong to the same (semantic) group.

A member group is defined by
a
A member group is defined by
a
\verbatim
///@{
///@{
...
///@}
\endverbatim
block or a
\endverbatim
block or a
\verbatim
/**@{*/
...
/**@}*/
\endverbatim
block if you prefer C style
comments. Note that the members of the group should be
/**@{*/
...
/**@}*/
\endverbatim
block if you prefer C style
comments. Note that the members of the group should be
physically inside the member group's body.

Before the opening marker of a block a separate comment block may be
placed. This block should contain the \ref cmdname "@@name"
(or \ref cmdname "\\name") command and is used to specify the header
Before the opening marker of a block a separate comment block may be
placed. This block should contain the \ref cmdname "@@name"
(or \ref cmdname "\\name") command and is used to specify the header
of the group. Optionally, the comment block may also contain more
detailed information about the group.

Nesting of member groups is not allowed.
Nesting of member groups is not allowed.

If all members of a member group inside a class have the same type
and protection level (for instance all are static public members),
then the whole member group is displayed as a subgroup of
the type/protection level group (the group is displayed as a
subsection of the "Static Public Members" section for instance).
If two or more members have different types, then the group is put
If all members of a member group inside a class have the same type
and protection level (for instance all are static public members),
then the whole member group is displayed as a subgroup of
the type/protection level group (the group is displayed as a
subsection of the "Static Public Members" section for instance).
If two or more members have different types, then the group is put
at the same level as the automatically generated groups.
If you want to force all member-groups of a class to be at the top level,
If you want to force all member-groups of a class to be at the top level,
you should put a \ref cmdnosubgrouping "\\nosubgrouping" command inside the
documentation of the class.
documentation of the class.

\par Example:
\include memgrp.cpp

\htmlonly
Click <a href="examples/memgrp/html/class_memgrp___test.html">here</a>
Click <a href="examples/memgrp/html/class_memgrp___test.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
Expand All @@ -211,16 +211,16 @@ different protection levels (i.e. public and protected).

Information can be grouped into pages using the \ref cmdpage "\\page" and
\ref cmdsubpage "\\mainpage" commands. Normally, this results in a
flat list of pages, where the "main" page is the first in the list.
flat list of pages, where the "main" page is the first in the list.

Instead of adding structure using the approach described in section
\ref modules "modules" it is often more natural and convenient to add
additional structure to the pages using the \ref cmdsubpage "\\subpage"
command.
\ref topics "topics" it is often more natural and convenient to add
additional structure to the pages using the \ref cmdsubpage "\\subpage"
command.

For a page A the \\subpage command adds a link to another page B and at
For a page A the \\subpage command adds a link to another page B and at
the same time makes page B a subpage of A. This has the effect of making
two groups GA and GB, where GB is part of GA, page A is put in group GA,
two groups GA and GB, where GB is part of GA, page A is put in group GA,
and page B is put in group GB.

\htmlonly
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Expand Up @@ -295,6 +295,7 @@ add_library(doxymain STATIC
memberdef.cpp
membergroup.cpp
memberlist.cpp
moduledef.cpp
msc.cpp
namespacedef.cpp
outputgen.cpp
Expand Down

0 comments on commit 6d80fc7

Please sign in to comment.