Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate ament_export_include_directories, _definitions, _libraries, _link_flags #365

Open
sloretz opened this issue Nov 29, 2021 · 0 comments
Assignees

Comments

@sloretz
Copy link
Contributor

sloretz commented Nov 29, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant