ament / ament/ament_cmake

Deprecate ament_export_include_directories, _definitions, _libraries, _link_flags

Aperta
#365 1 commento 0 reazioni 1 assegnatario Rivendicata da @sloretz Vedi su GitHub
Lingua principale
CMake
Stelle
125
Fork
147
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.