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

Reference Boost libraries individually in CMake per docs #1024

Open
wants to merge 1 commit into
base: RB-2.6
Choose a base branch
from

Conversation

YakoYakoYokuYoku
Copy link
Member

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. Additionally, make sure you've done all of these things:

PR Description

What type of PR is this? (Check one of the boxes below)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change which does not add functionality nor fixes a bug but improves Natron in some way)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • My change requires a change to the documentation
    • I have updated the documentation accordingly

What does this pull request do?

This fixes an annoying policy warning when using CMake. Referencing libraries directly with find_package has been supported way back in Boost.

Show a few screenshots (if this is a visual change)

N/A.

Have you tested your changes (if applicable)? If so, how?

By building and running Natron.

Futher details of this pull request

This might fix issues in other platforms such as BSD related to include directories.

@YakoYakoYokuYoku
Copy link
Member Author

@Martinfx, can you try this PR to see if it does the trick in FreeBSD?

@Martinfx
Copy link

@Martinfx, can you try this PR to see if it does the trick in FreeBSD?

I tested your branch on FreeBSD and this is result

maxfx@hades2 ~/D/Natron (boost-cmake-libs)> cmake .
-- The CXX compiler identification is Clang 18.1.6
-- The C compiler identification is Clang 18.1.6
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting build type to 'RelWithDebInfo' as none was specified.
CMake Error at CMakeLists.txt:55 (find_package):
  By not providing "Findboost_headers.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "boost_headers", but CMake did not find one.

  Could not find a package configuration file provided by "boost_headers"
  with any of the following names:

    boost_headersConfig.cmake
    boost_headers-config.cmake

  Add the installation prefix of "boost_headers" to CMAKE_PREFIX_PATH or set
  "boost_headers_DIR" to a directory containing one of the above files.  If
  "boost_headers" provides a separate development package or SDK, be sure it
  has been installed.


@Martinfx
Copy link

@YakoYakoYokuYoku You try to add (if else) for FreeBSD and for Linux

@YakoYakoYokuYoku
Copy link
Member Author

Can you check for both of boost_headers and boost_serialization in your lib/cmake directory? Both of them are in the devel/boost-libs plist, either you don't have those files or FreeBSD does something else for libraries that use CMake.

@Martinfx
Copy link

Can you check for both of boost_headers and boost_serialization in your lib/cmake directory? Both of them are in the devel/boost-libs plist, either you don't have those files or FreeBSD does something else for libraries that use CMake.

I am sorry my mistake. I have new installation OS. It is ok.

@devernay
Copy link
Member

devernay commented Dec 20, 2024

@YakoYakoYokuYoku I can't find the doc saying that this is the proper way to use boost from cmake.
My BoostConfig.cmake (boost 1.86.0) still contains:

# A typical use might be
#
# find_package(Boost 1.70 REQUIRED COMPONENTS filesystem regex PATHS C:/Boost)

Can you please give us a pointer?
I have the lib/cmake/boost_headers-1.86.0/boost_headers-config.cmake file, but I just can't find the doc that mentions the proper way to use boost

@YakoYakoYokuYoku
Copy link
Member Author

It's way down below in the boostorg/cmake README, seems that when I was copying it I've omitted the fragment, drats.

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