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

[question] Boost_<COMPONENT>_Found cmake variables missing ? #11085

Open
ggulgulia opened this issue Jun 8, 2022 · 2 comments
Open

[question] Boost_<COMPONENT>_Found cmake variables missing ? #11085

ggulgulia opened this issue Jun 8, 2022 · 2 comments
Labels
question Further information is requested

Comments

@ggulgulia
Copy link
Contributor

ggulgulia commented Jun 8, 2022

Hello there,

Description

  • I'm creating conan recipe for OGRE (recipe OGRE #11102) which is an important graphics rendering engine for many applications like games and simulations, including ignition-gazebo etc.
  • OGRE relies on boost and the standard boost cmake variables like Boost_THREAD_FOUND , Boost_DATE_TIME_FOUND etc .
  • The conan generated FindBoost.cmake doesn't seem to provide the cmake variables because of which the build doesn't work as expected

Comparison with official FindBoost.cmake cmake documentation

  • The official cmake for FindBoost.cmake sets these variables .
  • I also tried building OGRE with system installed boost and it worked fine since the system installed FindBoost.cmake sets these variables. See line 312 in the attached file (extension changed)
    FindBoost.cmake.txt

Question

  • Does conan recipe for boost provide these variables or any variable to verify if a component was found ?
  • If not, will CCI consider adding these cmake variables ?
  • Is there a recommended short term fix or a recipe that I can look into from another recipe and with which I can work now ?
@ggulgulia ggulgulia added the question Further information is requested label Jun 8, 2022
@ggulgulia ggulgulia mentioned this issue Jun 23, 2022
4 tasks
@prince-chrismc
Copy link
Contributor

doesn't seem to provide the cmake variables because of which the build doesn't work as expected

You are correct they are not provided, I was trying to see if there a reason the might have been mentioned but I as not able.

Does conan recipe for boost provide these variables or any variable to verify if a component was found ?

I have two paths as a community reiviewer

  • Using if checks in the CMake for targets if(TARGET Boost::thread)
  • Validate the components in the conanfile and assume they are present in CMake

the second option is prefered, since Conan can ensure the correct package is used,

def _required_boost_components(self):

@ggulgulia
Copy link
Contributor Author

ggulgulia commented Jun 24, 2022

Thanks for the response.

The second option seems correct but in the case where the components are searched on CMake level like in OGRE,

 if (NOT Boost_THREAD_FOUND)
        set(OGRE_DEPS_FOUND FALSE)
 else ()
 ...

we will still need set the variable Boost_<COMPONENT>_FOUND for CMake through patches for build to work correctly. Considering Boost is a dependency for many applications, adding patches is not easy especially when the if-else branching is not trivial like in OGRE. It might be worthwhile to provide the standard cmake variable as done by FindBoost.cmake unless there's a strong reason to not provide them.

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

No branches or pull requests

2 participants