diff options
author | Friedrich W. H. Kossebau <kossebau@kde.org> | 2022-06-12 16:13:22 +0200 |
---|---|---|
committer | Friedrich W. H. Kossebau <kossebau@kde.org> | 2022-06-12 18:27:40 +0200 |
commit | 9edb5f57127489dec4b7cbdc1e60920e6002abea (patch) | |
tree | 712d3aaeb2d5caa9adc80f2c6e1e4412b54efb97 /modules/ECMGenerateHeaders.cmake | |
parent | 0ec7ce6f1e2b5b1c914897e7a58f62835cc27ce5 (diff) | |
download | extra-cmake-modules-9edb5f57127489dec4b7cbdc1e60920e6002abea.tar.gz extra-cmake-modules-9edb5f57127489dec4b7cbdc1e60920e6002abea.tar.bz2 |
API dox: use more markup for code or commandline samples
NO_CHANGELOG
Diffstat (limited to 'modules/ECMGenerateHeaders.cmake')
-rw-r--r-- | modules/ECMGenerateHeaders.cmake | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/modules/ECMGenerateHeaders.cmake b/modules/ECMGenerateHeaders.cmake index 4da0f379..86f35adb 100644 --- a/modules/ECMGenerateHeaders.cmake +++ b/modules/ECMGenerateHeaders.cmake @@ -22,24 +22,24 @@ Generate C/C++ CamelCase forwarding headers. [COMMON_HEADER <HeaderName>] [RELATIVE <relative_path>]) -For each CamelCase header name passed to HEADER_NAMES, a file of that name +For each CamelCase header name passed to ``HEADER_NAMES``, a file of that name will be generated that will include a version with ``.h`` or, if set, ``.<header_extension>`` appended. For example, the generated header ``ClassA`` will include ``classa.h`` (or -``ClassA.h``, see ORIGINAL). +``ClassA.h``, see ``ORIGINAL``). If a CamelCaseName consists of multiple comma-separated files, e.g. ``ClassA,ClassB,ClassC``, then multiple camelcase header files will be generated which are redirects to the first header file. The file locations of these generated headers will be stored in <camelcase_forwarding_headers_var>. -ORIGINAL specifies how the name of the original header is written: lowercased -or also camelcased. The default is LOWERCASE. Since 1.8.0. +``ORIGINAL`` specifies how the name of the original header is written: lowercased +or also camelcased. The default is "LOWERCASE". Since 1.8.0. -HEADER_EXTENSION specifies what file name extension is used for the header +``HEADER_EXTENSION`` specifies what file name extension is used for the header files. The default is "h". Since 5.48.0. -PREFIX places the generated headers in subdirectories. This should be a +``PREFIX`` places the generated headers in subdirectories. This should be a CamelCase name like ``KParts``, which will cause the CamelCase forwarding headers to be placed in the ``KParts`` directory (e.g. ``KParts/Part``). It will also, for the convenience of code in the source distribution, generate @@ -47,36 +47,36 @@ forwarding headers based on the original names (e.g. ``kparts/part.h``). This allows includes like ``"#include <kparts/part.h>"`` to be used before installation, as long as the include_directories are set appropriately. -OUTPUT_DIR specifies where the files will be generated; this should be within +``OUTPUT_DIR`` specifies where the files will be generated; this should be within the build directory. By default, ``${CMAKE_CURRENT_BINARY_DIR}`` will be used. This option can be used to avoid file conflicts. -REQUIRED_HEADERS specifies an output variable name where all the required +``REQUIRED_HEADERS`` specifies an output variable name where all the required headers will be appended so that they can be installed together with the generated ones. This is mostly intended as a convenience so that adding a new header to a project only requires specifying the CamelCase variant in the CMakeLists.txt file; the original variant will then be added to this variable. -COMMON_HEADER generates an additional convenience header which includes all +``COMMON_HEADER`` generates an additional convenience header which includes all other header files. -The RELATIVE argument indicates where the original headers can be found -relative to CMAKE_CURRENT_SOURCE_DIR. It does not affect the generated -CamelCase forwarding files, but ecm_generate_headers() uses it when checking +The ``RELATIVE`` argument indicates where the original headers can be found +relative to ``CMAKE_CURRENT_SOURCE_DIR``. It does not affect the generated +CamelCase forwarding files, but ``ecm_generate_headers()`` uses it when checking that the original header exists, and to generate originally named forwarding -headers when PREFIX is set. +headers when ``PREFIX`` is set. To allow other parts of the source distribution (eg: tests) to use the generated headers before installation, it may be desirable to set the -INCLUDE_DIRECTORIES property for the library target to output_dir. For -example, if OUTPUT_DIR is CMAKE_CURRENT_BINARY_DIR (the default), you could do +``INCLUDE_DIRECTORIES`` property for the library target to output_dir. For +example, if ``OUTPUT_DIR`` is ``CMAKE_CURRENT_BINARY_DIR`` (the default), you could do .. code-block:: cmake target_include_directories(MyLib PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>") -Example usage (without PREFIX): +Example usage (without ``PREFIX``): .. code-block:: cmake @@ -93,7 +93,7 @@ Example usage (without PREFIX): DESTINATION ${CMAKE_INSTALL_PREFIX}/include COMPONENT Devel) -Example usage (with PREFIX): +Example usage (with ``PREFIX``): .. code-block:: cmake |