Skip to content

Conversation

@idesign0
Copy link

This PR improves the CMake logic used to locate Boost.Python in cv_bridge.

Recent Boost versions (e.g. 1.89) built with CMake no longer generate
versioned CMake package config files for Python components such as:

boost_python311-config.cmake

Instead, the only available package config file is the generic component:

boost_python-config.cmake

This causes the current logic:

    find_package(Boost REQUIRED COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
    set(boost_python_target "Boost::python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")

to fail even though the library file libboost_python311.* exists.

Cause

CMake-built Boost installs:

  • libboost_python<pyver>.*
  • a generic CMake target: Boost::python

But does not install:

  • Boost::python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}
  • boost_python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}-config.cmake

As a result, CMake cannot resolve the requested versioned component, and the
configuration step fails even though the underlying library file exists.

CMake Side FIx

Use versioned Boost.Python components when available, and automatically fall back to the generic python component when they are not.
This makes the CMake logic compatible with both CMake-built and Autotools-built Boost installations.

idesign0 and others added 4 commits November 26, 2025 20:07
Signed-off-by: Dhruv Patel <dhruvpatel2991998@gmail.com>
FIX:

#UserWarning: Unknown distribution option: 'tests_require'

and

#SetuptoolsDeprecationWarning: License classifiers are deprecated. !!
* Fix final confusion between format and encoding.
Format is file format like jpg, bmp and more,
encoding is color encoding like bgr8, rgb8 and more.

* Update cv_bridge/src/cv_bridge.cpp

Co-authored-by: Chris Lalancette <clalancette@gmail.com>

---------

Co-authored-by: Chris Lalancette <clalancette@gmail.com>
* fix cmake deprecation

cmake version < then 3.10 is deprecated

* Update CMakeLists.txt
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

Successfully merging this pull request may close these issues.

3 participants