-
Notifications
You must be signed in to change notification settings - Fork 978
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
Boost in yocto SDK and in .conan2 #14343
Comments
Thanks for reporting this. I think we are more or less aware of this issue (#12478 for example), but it also seems complicated to fix. CMake has some limitations and doesn't have a nice mechanism to express the right priority for finding packages when there are different origins for the config.cmake scripts in the case of sysroot + using a package manager. We need to investigate this and see if we can find any better solution. |
Hi @AndersGnistrup - thank you for reporting this issue. If the answer is "NO", you can try setting If the answer is "yes", it depends on whether you are able to change the Note that I'm assuming you are using Conan 2.0 and the |
Hi @jcar87 - Yes, there are a few in the SDK, and yes, I am using the CMakeToolchain and CMakeDeps generators. But, thanks for the hint about CMAKE_FIND_ROOT_PATH_MODE_PACKAGE 👍 |
Hi @AndersGnistrup - thanks for the follow-up. If you know how many libraries are in both the SDK and in Conan, and it is not too many, you can try adding
that should have the same effect, only for those libraries. In this case, it would first look in the |
I'm seeing a similar situation; one package from my dependency tree is provided by my SDK, but it's not the conan version of the package, so the cmake target names don't match what CMakeDeps tries to consume when it tries to define how use that dependency. Rather than setting find paths and letting CMake resolve where dependencies are, is there a reason CMakeDeps/CMakeToolchain shouldn't just specify exactly the locations of dependencies Conan provides and shortcut the whole search procedure?
This would give a priority to things conan provides, and wouldn't mess with other search rules. When using a Yocto SDK, I prefer the "FIND_ROOT_PATH_MODE NEVER" settings that the SDK toolchain file sets, because then I don't accidentally link against my host system binaries; and right now, Conan has to change those to BOTH so that searches can find things Conan provides. EDIT: Removed wrong and extraneous details |
I ended up using CMAKE_FIND_ROOT_PATH_MODE_PACKAGE = NEVER and added additional paths. |
That's not what
There is no value that you can set |
I use the following to prevent this in the our Yocto SDK: |
I'm facing exactly the same problem. I have a yocto SDK from where I pick up a toolchain, most of the libraries my app relies on are provided by Conan2. I expose the compiler using the My |
Another weird issue i'm tracking down and seems related:
It has a
...
I don't know if there is a scenario where a If I delete the crosscompiled
|
One last update (sorry for the noise) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER) This is not optimal since, IIUC, then the packages from the sysroot will be completely ignored now, but I can live with that (for now?).
|
I define them in a custom toolchain file and set it using the config
setting:
```
tools.cmake.cmaketoolchain:user_toolchain
```
|
I consider it, but it felt hacky. It adds a layer of indirection. I was looking at something more conan-native, e.g.
But it looks like it is not supported. |
What is your question?
I am using conan 2.0.8 and imports an yocto SDK containing a toolchain and some fundamental applications used in the platform.
I have made a host profile that points to the compiler. In this operation the tools.build:sysroot is set in the conf section.
This seems to generate some problems, since some libraries exists in both .conan2 and in the SDK, including the BoostConfig.cmake (among others).
During the build process the "wrong" BoostConfig.cmake is found in the SDK, but I would like to use the version in the conan2 system. If a rename the BoostConfig.cmake in the SDK the correct BoostConfig.cmake is found but this seems a "wrong" solution.
I have tried several solutions and read quite a lot of posts/docs but have not found a good solutions so what is the recommended method to import an SDK.
I have some idea's
Distributing and using a Yocto SDK via conan #7431 (comment)
This seems to be a valid path since stuff can be defined in components and special libraries can be masked.
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: