You can use the Adaptive SDK in your CMake projects and save time compiling. It is as simple as adding a few lines to your project-wide CMake configurations in the CMakeLists.txt.

notice

File Location: MyAdaptiveProject/CMakeLists.txt

Steps

  1. Prerequisite: The Adaptive SDK was created and is made available.
  2. Prerequisite: Your system fulfills the system requirements of the MICROSAR Adaptive BSW package
  1. Specify the SDK path.
  2. Locate the AMSR package with find_package().
  3. Integrate the generated CMake files into the project.
  4. Link against the appropriate targets.

 

CMakeLists.txt

# Set the search location for the AMSR SDK
set(AMSR_ROOT "path/to/AdaptiveSDK")

# Find CMake Config files of AMSR package
# Simple command (Missing targets are found at build time)
# find_package(AMSR REQUIRED)
# Advanced command (Missing targets are found at configuration time)
find_package(AMSR
  COMPONENTS amsr::vac
  REQUIRED
)
# The variable "target" is important here because it is expected
# in the generated CMake files
set(target MyAdaptiveApplication)

# Please note: SRC_GEN_DIR locates to the folder where the code is
# generated
file(GLOB LIST_OF_SRC_GEN_CMAKE_FILES "${SRC_GEN_DIR}/MyAdaptiveApplication/*.cmake")
block()
  foreach(CMAKEFILE_TO_INCLUDE IN LISTS LIST_OF_SRC_GEN_CMAKE_FILES)
    include(${CMAKEFILE_TO_INCLUDE})
  endforeach()
endblock()

# Specify the libraries to be linked into the user build artifact
target_link_libraries(
  MyAdaptiveApplication
  PRIVATE
    amsr::vac
)

Components / Link Targets

notice

Note: The list of pre-built and installed targets (libraries and/or executables) may vary depending on the content of the delivery. In addition, the number of available targets depends on the build configuration.

Component / Target

Cluster

amsr::applicationbase

Base Libraries

amsr::vac

Base Libraries

amsr::com_default

Communication

amsr::com_r18_03

Communication

amsr::com_r20_11

Communication

amsr::comtrace

Communication

amsr::ipcbinding

Communication

amsr::someipbinding

Communication

amsr::someipprotocol

Communication

amsr::zerocopybinding

Communication

amsr::aradiag

Diagnostics

amsr::em_application_client

Execution Management

amsr::em_state_client

Execution Management

amsr::log

LOG

amsr::log_ara_logging

LOG

amsr::osa_common

Operating System

amsr::osa_net

Operating System

amsr::per

Persistency

amsr::sm_functiongroupcontrol

State Management

amsr::sm_lifecycle

State Management

amsr::sm_runtime

State Management

amsr::sm_statemachine

State Management

notice

Reference: To find the CMake link targets for a certain component, please refer to the Technical Reference at <BSW Package>/Docs/Technical References.

An exhaustive list of all available link targets is generated with the build cache and can be found at <MyAdaptiveProject>/build/<preset>/AMSRConfig.cmake.