-
Notifications
You must be signed in to change notification settings - Fork 989
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] How to make conan 1.59.0 add "architecture": "x64"
to CMakePresets.json?
#13792
Comments
Thanks very much @garyo for the detailed report. Certainly, the behavior seems unexpected and wrong. I think we should be reporting this to CMake, before trying to do a workaround in Conan, it might be possible that there could be other configuration involved like Would you like to report it to CMake yourself? (this can be easily reproduced without Conan). Otherwise we could probably do it. Thanks! |
Issue reported to cmake at https://gitlab.kitware.com/cmake/cmake/-/issues/24864 -- hope that helps! I'll report back here if & when I hear from them. |
Perfect, many thanks @garyo ! |
I think I'm experiencing the same issue For now I'm able to work around it by using a
|
Hi @rob-avalon I'd suggest to upvote or comment on the CMake reported issue by @garyo, to drive a bit more attention over it, to see if they respond. |
@garyo I also upvoted and commented on the Kitware issue, asking for an analysis. Their README says to ask on their forums before reporting an issue. Any chance you could make a forum posting asking about it, referring to your test case? Perhaps it would draw the attention of the developers. This is looking to be a big enough problem that we might have to alter the P.S. We're probably along way out from being able to adopt Conan 2 (we have to convert a huge SCons project to use CMake) so can any potential Conan fix also be in 1.x? |
It sounds challenging. The thing is that Conan must support CMake 3.15, without presets at all. And there is nothing that really tell Conan about CMake version when |
Just as an idea: if conan could add an option for users to add arbitrary info to the generated CMake preset (either as a command-line option or any other way) then it wouldn't affect conan's compatibility with anything; we users would be responsible for adding the particular line when we know it's needed (already knowing the conan and cmake versions). Maybe just merge in a user-provided piece of json? Basically just to save us from having to postprocess the preset. I'm not on their forum but I'll see what I can do. |
Never mind this....it's supposed to be a cache variable, see below Maybe it could be conditional on versions that don't have presets? if(${CMAKE_VERSION} VERSION_LESS "3.19")
set(CMAKE_GENERATOR_PLATFORM "x64" CACHE STRING "" FORCE)
endif() Or...maybe it shouldn't be a cache variable? Changing it to this fixes the problem set(CMAKE_GENERATOR_PLATFORM "x64") Also, one example in the CMake doc shows a toolchain file setting platform and toolset variables as regular variables, not cache variables. set(CMAKE_GENERATOR_TOOLSET CE800) # Can be omitted for 8.0
set(CMAKE_GENERATOR_PLATFORM SDK_AM335X_SK_WEC2013_V310) |
Never mind the above. Brad King replied:
|
#11623 (comment) reported by @manuelnp seems the same as this ticket. |
Even if I still think this shouldn't be the expected behavior from CMake, it is clear that this is biting more users like latest @manuelnp, so I am checking the impact of adding it to the presets. Even if it seems that it can be done, I am still concerned that this might break in unexpected ways or in future CMake versions as the discussion in https://gitlab.kitware.com/cmake/cmake/-/issues/24864 shows. |
Same problem here using Conan 2, and I can confirm that
Unfortunately, setting
I'm not sure if Visual Studio's "Open Folder experience" is affected by the problem but if it is, then I guess you cannot easily set these CLI options. At least in VS 2019, you can't use "Open Folder" anyway because the built-in CMake version doesn't support |
This is what I wanted to try, and try to evaluate if it could be breaking, adding twice the information, both in |
Thanks, that would be great to have a fix for this.
I think this will be biting anyone using CMake presets with Visual Studio, right? FWIW, we've been using the same workaround as @Simran-B. |
This is blocking our release of OpenFX -- any suggestions for ways to work around it? |
This was assigned for checking in 2.0.15. Opening #15215 to see what breaks and start having a deeper look |
As a quick question: I assume that the change in #15215 is the necessary one to solve this issue, isn't it? (at least to make it work with cmake-presets) |
#15215 merged, this will be in next 2.0.15 release, feedback welcome! |
Seems to work great! Thanks for doing this. |
You are welcome @garyo thanks for the feedback! |
Looks like they've recently fixed this in CMake, as well: https://gitlab.kitware.com/cmake/cmake/-/commit/0654051dde88dfb8e374ac7e53bfc46c574b0169. I'm not sure in which CMake version this will land, but it must be newer than 3.27.8. |
I'm also using your fix, @memsharded, with conan2 plus the latest CMake 3.28.1, and it is working for me. Thanks! Better to let this in for now. |
What is your question?
I'm using conan 1.59 on Windows, with cmake 3.23.0. I find that if I run my build script (https://github.com/AcademySoftwareFoundation/openfx/tree/cmake) twice, it fails the second time with this error:
This error, which happens during
cmake --preset default
, is apparently because theCMakePresets.json
that conan generates is missing theconfigurePresets[0].architecture
flag, which should be set tox64
. It seems like settingCMAKE_GENERATOR_PLATFORM
inconan_toolchain.cmake
is not enough to prevent the above error.How can I make conan create a cmake preset that includes the
architecture
flag? Or if there's a different way to fix this, that would be great too.You can repro this with the above open-source github repo. Clone it on Windows with conan 1.59.0 and cmake 3.23.0, check out the
cmake
branch, then runbuild-cmake.sh
twice (using an msys bash shell).Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: