-
Notifications
You must be signed in to change notification settings - Fork 990
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] Packaging prebuilt projects with existing FooConfing.cmake and Generating Multiple CMake Presets #15772
Comments
Hi @sufuk
Not an issue! 🙂
I am not sure what is the issue. You can see in https://docs.conan.io/2/examples/tools/cmake/cmake_toolchain/build_project_cmake_presets.html, how it works for multi-config, but the same approach also works for more configurations, by defining the conf
Sure, Conan is not a build system, it is not a build tool, it just wraps and call Conan when necessary. Having a All the Conan can also work with xxx-config.cmake files inside packages, with some limitations (mostly due to cmake), please check: https://docs.conan.io/2/examples/tools/cmake/cmake_toolchain/use_package_config_cmake.html So I'd say that things should work as you desire. If there is something that is not behaving like you expect, the best would be to put a simple and minimal reproducible example in a repo, so we can check it, reproduce and advice. Like some toy example |
Hello @memsharded Thank you for your response, |
Hello again @memsharded
|
The The So I am not sure what could be happening, we would need to have something we could reproduce to understand the issue. Thanks! |
It depends, if you are in Windows with msvc, by default it will be multi-config, because CMake Visual Studio generator is multi-config. This is why the reproducible case is important, clarifying the files used, the commands, and also the inputs (OS, compiler), and reporting on the full output... |
Hello @memsharded it turns out key is using tools.cmake.cmake_layout:build_folder_vars="['settings.os', 'settings.arch']" I have only one question it not a problem I fixed it for me in conanfie.py generator method, but is there any way to use relative paths for for example toolchainFile in the CMakePresets.json and include paths for presets in User Preset file? |
Excellent, I am happy that my suggestion above (
Yes, we try to make paths relative whenever possible, to allow some relocatibility. I am not sure why these paths are not relative, maybe it doesn't work, but we can give it another try. |
Hello @memsharded thanks four your quick response again with absolute paths It is impossible to call conan install in the host and built project in the docker container(Mounted conan cache of host and project dir), but with relative paths it works quite good, I didn't see any problem, |
#16015 has been merged and has closed this issue. It will be in next Conan 2.3. If there is any further issue, please create a new ticket, thanks! |
What is your question?
Hello,
I apologize for my lack of English,
We use conan to package manage our projects that use cmake and are used in various operating systems (macos, linux, android) and architectures (arm64, x86_64, x86, armv7, armv6). We can only use Conan for already compiled binaries because we need complex build systems to compile projects and even have to use docker for armv6 because the GCC version we use is extremely old (4.2.3) and the toolchain can only run on x86 Linux.
While developing the projects, we wrote a script that loads these packages with conan for all architectures and operating systems and creates a CMakePresets.json containing separate presets for each configuration. The presets contain their own FOO_DIR cache values.
The problem is that we need to rewrite this script for each project, and we cannot use CMakeToolChain or CMakeDeps because the presets they create are for only one configuration.
I wonder if there is a way to force CMakeToolChain and CMakeDeps to create presets for multiple configurations?
Also we don't want to edit our CMake files for conan and we dont want to use conan as a build tool because cmake do this excellently and we are not comfortable to depend on conan entirely even if its self hosted.
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: