GenerateOppMessage¶
This module provides the generate_opp_message function, which has the following signature.
generate_opp_message(<INPUT_MSG_FILE>
[MSG4]
[TARGET target]
[OUTPUT_ROOT directory]
[DIRECTORY directory]
[GEN_SOURCES var]
[GEN_INCLUDE_DIR var]
[ADDITIONAL_NED_PATHS path ...]
)
-
generate_opp_message
¶
At least the <INPUT_MSG_FILE> argument must be given, which is the *.msg file passed to the OMNeT++ message compiler. The OMNeT++ message compiler must be known via the OMNETPP_MSGC variable, which is usually set by the FindOmnetPP.
MSG4
Forces the message compiler to process the input file as OMNeT++ 4.x message file.
TARGET
Add the generated sources to the given target by calling target_sources. The OUTPUT_ROOT directory is added as include directory to this target as well.
OUTPUT_ROOT
The root directory where the output files will be generated. ${PROJECT_BINARY_DIR}/opp_messages is used as default directory.
DIRECTORY
Optional sub-directory relative to OUTPUT_ROOT, i.e. the given path is appended to OUTPUT_ROOT.
GEN_SOURCES
Name of an output variable which gets populated with the generated filenames.
GEN_INCLUDE_DIR
Name of an output variable which gets populated with the include directory for using the generated messages.
ADDITIONAL_NED_PATHS
Further import paths during message compilation. These paths are passed on to the message compiler as -I arguments.
Earlier implementations provided a clean_opp_messages macro to delete the generated sources from the source tree. Nowadays, message files are compiled in the build directory and CMake automatically removes generated artifacts with its clean target. The clean_opp_messages is thus no longer needed and has been removed.