Support Modern CMake practices

Open
#245 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
cmake, cpp
Domain
build-system

Research direction

The issue names no specific files or tests; begin by locating the image_common package CMake configuration and reviewing the current include, dependency, installation, and export calls. Compare the package's targets with the modern CMake and ament_cmake references, then verify that the listed targets can be consumed through the proposed CONFIG-mode names by gscam2.

Written by the indexing model from the issue text.

Description

As a user of this library in gscam2, I'd like to consume the libraries in image_common with a modern cmake interface, but it's not supplied here.

Here's my proposal:

  • Replace calls to include_directories with target_include_directories
  • - Add ALIAS libraries for better determinism
  • - Replace calls to ament_target_dependencies with target_link_libraries
  • - Specify linkage type as PUBLIC, PRIVATE or INTERFACE when calling target_link_libraries
  • - Bump Minimum cmake for galactic to 3.12.2 and use some of the new features in it for installation
  • - Add an EXPORT set to the install commands
  • - Support a CONFIG mode export to support find_package allowing consumers to link to targets like camera_calibration_parsers::camera_calibration_parsers
  • - Remove ament_export_include_directories and ament_export_libraries calls as they are superfluous
  • - Could use ament_auto_package to handle the install of the targets

References:

Dominant language
C++
Stars
153
Forks
253
Avg merge
5m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ros-perception/image_common

All issues in ros-perception/image_common

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.