Skip to content

Deprecate ament_export_include_directories, _definitions, _libraries, _link_flags #365

@sloretz

Description

@sloretz

There are a few ament_cmake functions that support old-style standard CMake variables. They are no longer needed in modern CMake. The equivalent standard CMake functions are advantageous to use because they're target based instead of project based. That allows targets in a package to use only the targets they need from another cmake package, potentially saving build time and code size.

Deprecating these methods seems like a good idea because ament_export_targets() usage already seems widespread, making the old-style standard variables redundant.

ament_export_include_directories() is a function that makes sure the variable foobar_INCLUDE_DIRS gets set when someone calls find_package(foobar). This is an old style "standard CMake variable", and it isn't needed when exporting targets. I think it should be deprecated with a message to use target_include_directories() and ament_export_targets() instead.

ament_export_definitions() causes the foobar_DEFINITIONS variable to be set, and can be deprecated in favor of target_compile_definitions() and ament_export_targets().

ament_export_libraries() causes the foobar_LIBRARIES variable to be set, and can be deprecated in favor of target_link_libraries() and ament_export_targets().

ament_export_link_flags() causes the foobar_LINK_FLAGS variable to be set, and can be deprecated in favor of target_link_options() and ament_export_targets().

Somewhat related to #292

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions