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

Why is the cmake configuration in Boost deleted when packaging ? #1818

Closed
sflis opened this issue Jun 3, 2020 · 3 comments
Closed

Why is the cmake configuration in Boost deleted when packaging ? #1818

sflis opened this issue Jun 3, 2020 · 3 comments

Comments

@sflis
Copy link

sflis commented Jun 3, 2020

Why is the cmake configuration in Boost deleted when packaging?

tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))

From boost 1.70 boost provides its own cmake configuration file which depracated the BoostFindModule.cmake that cmake provides. If I chose to use cmake for package discovery by using find_package( ) together with the cmake_paths generator in conan it will not find the configuration file since it is removed in the conan package. Instead it will pick up the BoostFindModule.cmake.

This does not follow cmake best practices. I would like to propose to remove that line and ship boost with it's cmake configuration.

@TimSimpson
Copy link
Contributor

My understanding is Conan itself supports being able to save CMake config files in Conan packages, but Conan Center doesn't believe this is a good practice. The reasoning is when the CMake config files are called they create their own graph for all of a project's transitive dependencies which may or may not match up to Conan's, which leads to problems. The example I was given is that they may include a system installed version of openssl while other dependencies from the same project are using a newer version specified by Conan.

However my understanding is recent additions to Conan enable it to emulate most things the "official" CMake package config files are doing. It's possible to use self.cpp_info.names for instance to tell Conan to generate CMake files that give targets the same names used by their "official" CMake created config files, and macros found in the CMake package config files can be exported to modules set by self.cpp_info.build_modules which are then included. So basically, the hope is Conan can replicate whatever the CMake package config script does while better controlling the dependency graph.

@uilianries
Copy link
Member

@sflis The motivation for removing: https://github.com/conan-io/conan-center-index/wiki/FAQ#why-are-cmake-findconfig-files-and-pkg-config-files-not-packaged

About the modules for Boost, there is an initial effort: #1925

I would like to propose to remove that line and ship boost with it's cmake configuration.

This won't happen. Conan 1.26 provides a new support for modules, involving cmake_find_package generator. It should be enough for generating the correct FindBoost.cmake file (including the modules), it's just a matter of time until having that PR available.

@jgsogo
Copy link
Contributor

jgsogo commented Jul 17, 2020

If needed, please continue on this issue #209. I suppose this is not specific to Boost itself and it is easier to try to centralize things.

Thanks!

@jgsogo jgsogo closed this as completed Jul 17, 2020
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

No branches or pull requests

4 participants