-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
What is your question?
Updating to conan 2.3.2
I'm building packages via a Yocto based x-compilation toolchain, and the SDK generates this toolchain for us. It is vital to use it as it sets CMAKE_FIND_ROOT_PATH among other things, to find packages that are in the SDK and does not come from Conan. Therefore I override the generated toolchain with the tools.cmake.cmaketoolchain:toolchain_file option.
However this poses a problem when we also have requirements statements for our Conan requirements. Conan generates the correct <dep>-config.cmake files for each requirement, but they end up under .../build/Release/generators. As we are using a custom toolchain, we have no way of knowing this path in beforehand, and therefore we dont know how to set the CMAKE_MODULE_PATH.
If I instead do NOT use the custom toolchain file, but rely on the generated one from Conan with CMakeToolchain, I find the requirement packages as the module path is calculated and added to the toolchain file. But then I get problems for packages in our cross-compilation SDK that we cannot find.
The solution we had in Conan 1.63 was to use the old syntax without toolchain etc, and using cmake_find_package. This worked, even with a custom toolchain file, because the Find<dep>.cmake files ended up in the build folder. As cmake_find_package is deprecated, I want to move away from this.
What is the best practice here?
Have you read the CONTRIBUTING guide?
- I've read the CONTRIBUTING guide