From 8c8041871200214921275e65c39205dc7e4fe6b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ferreira=20Gonz=C3=A1lez?= Date: Fri, 16 May 2025 10:04:30 +0200 Subject: [PATCH] Docs - Apply custom templates to included IDL files (#1066) * Refs #23150: Apply custom templates to included IDL files Signed-off-by: cferreiragonz * Refs #23150: Apply suggestion Signed-off-by: cferreiragonz --------- Signed-off-by: cferreiragonz (cherry picked from commit bf0dfe627edfb8c98dac22c3635a958a326d85ae) --- code/FastDDSGenCodeTester.cpp | 1 + docs/fastddsgen/dataTypes/dataTypes.rst | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/code/FastDDSGenCodeTester.cpp b/code/FastDDSGenCodeTester.cpp index 8829bea92..54fc8b0ba 100644 --- a/code/FastDDSGenCodeTester.cpp +++ b/code/FastDDSGenCodeTester.cpp @@ -182,5 +182,6 @@ enum MyBitMask : uint8_t // INCLUDE_MORE_IDL_FILES #include "OtherFile.idl" #include + #include //! /**/ diff --git a/docs/fastddsgen/dataTypes/dataTypes.rst b/docs/fastddsgen/dataTypes/dataTypes.rst index 3028904b7..bd11a3063 100644 --- a/docs/fastddsgen/dataTypes/dataTypes.rst +++ b/docs/fastddsgen/dataTypes/dataTypes.rst @@ -450,6 +450,23 @@ If *Fast DDS-Gen* does not find a C/C++ preprocessor in default system paths, th using parameter ``-ppPath``. The parameter ``-ppDisable`` can be used to disable the usage of the C/C++ preprocessor. +The parameter ``-extrastg`` can also be used to apply custom templates to included IDL files. +To enable this feature, the output file name passed to ``-extrastg`` must include the character ``@``, which will be +replaced by the name of the included file to generate the output file. + +The following command will generate two custom templates, one for the main IDL file and another for the included one: + +- ``MainIDL_Custom.cpp`` +- ``IncludedIDL_Custom.cpp`` + +Where ``IncludedIDL.idl`` is included in ``MainIDL.idl`` file. + +.. code-block:: bash + + /scripts/fastddsgen MainIDL.idl -I -extrastg /Custom.stg @_Custom.cpp + +Check :ref:`fastddsgen_supported_options` for more information about the ``-extrastg`` option. + Annotations --------------