ament / ament/ament_cmake

Example of using ament_export_definitions() from ament_cmake_export_definitions

Open
#356 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
CMake
Stars
125
Forks
147
PR merge metrics
No merged PRs in 30d

Description

Hello,

I'm trying to create a meta package for ament to build the same packages with different preprocessor definitions for different code functionalities.
Is there any example of using this and gathering the definition in the downstream package.

While this is not an issue, I am struggling to find example usage between an upstream and downstram package. I thought since this is a newish module that it would be best to go here.

For example:

In metapackage1/CMakeLists.txt I have:

```

ament_export_defintiion(PLAT1=1)``
ament_package()

```

In downstream package/CMakeLists.txt, I have

```
if(${PLAT1})
message('got definition")
endif()

```

But I don't get any indication that the variable was defiined. Am I using this wrong? I would really appreciate an example if possible. Thanks so much!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.