Configurations in CMakeLists.txt
In the following sections you will learn about several CMake variables and commands that are used in the CMake configuration file for the Hello World Application.
|
CMake Configuration File Location:
|
HWSRC_APP_OUTPUT_NAME
The variable HWSRC_APP_OUTPUT_NAME defines the name of the
executable. TACO evaluates variables named
<target-upper>_OUTPUT_NAME to deduce the executable name
from the target name.
add_subdirectory()
add_subdirectory("${AMSR_SRC_SYMLINK}" "AMSR")
The Vector Embedded Software stack is included as source sub-project. This means that:
-
The Vector Embedded Software stack and the Hello World Application share one build-directory.
-
Both projects can be initialized and built with one CMake command.
-
The CMake files of the Hello World Application can directly reference targets from the Vector Embedded Software stack,
find_package()is not needed.
taco_target_properties
The content in these files includes the hello_world subdirectory and makes sure that the MICROSAR Adaptive daemons are build and installed together with the hello world application.
|
This is for demonstration purposes only. In a real world application you would build your own daemons and provide your own configuration files. |
app/hello_world/CMakeLists.txt
The function dvacfg_file_gen() makes sure that the generators
for the models are run.
In this example the keyword argument OUTPUT lists generated CMake
files instead of source and config files. This has the advantage that
you do not need to list each generated file individually.
dvacfg_file_gen() also adds the generated files as dependency
to the target sources of hwsrc_app.
|
Reference: For more information, see the
TACO Guide in your delivery
under |
find_package (TACO REQUIRED)
TACO is included with a call to find_package
– CMake’s standard mechanism for external packages.
The variable TACO_ROOT is set in
CMakePresets.json to the corresponding
directory in the MICROSAR Adaptive delivery.
The find_package call automatically sets the correct
CMAKE_MODULE_PATH, so that TACO modules can be included and
found modules can be referenced later on.