[bug] CMakeToolchain: don't set CMAKE_GENERATOR_PLATFORM if Visual Studio xx yyyy arch
See original GitHub issueEnvironment Details (include every applicable attribute)
- Operating System+version: Windows 10
- Compiler+version: Visual Studio 2017
- Conan version: 1.41.0
- Python version: 3.9.7
Steps to reproduce (Include if Applicable)
- Call conan install with
CMakeToolchain
generator andVisual Studio 15 2017 Win64
cmake generator. - give this toolchain in a cmake command line with
Visual Studio 15 2017 Win64
generator.
Logs (Executed commands with output) (Include/Attach if Applicable)
CMake Error at CMakeLists.txt:5 (project):
Generator
Visual Studio 15 2017 Win64
does not support platform specification, but platform
x64
was specified.
Actually, I don’t have Windows currently to confirm this error log, issue comes from https://cpplang.slack.com/archives/C41CWV9HA/p1633648840443400
The solution would be to not set CMAKE_GENERATOR_PLATFORM
when some characters have been specified after the year in the Visual Studio generator. So I guess more test here: https://github.com/conan-io/conan/blob/d81f5a15ce058cb8f57433d352022242735029f1/conans/client/build/cmake_flags.py#L90-L91
See https://cmake.org/cmake/help/latest/generator/Visual Studio 15 2017.html#platform-selection (but also previous Visual Studio versions, Win64 & ARM are not the only cases in those old versions).
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (7 by maintainers)
Top Results From Across the Web
CMakeToolchain — conan 1.53.0 documentation
Available since: 1.32.0. The CMakeToolchain is the toolchain generator for CMake. It will generate toolchain files that can be used in the command...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It resolves my issue - I was using the legacy cmake helper.
However, @SpaceIm was commenting on a behavior of the current helper. @SpaceIm can close, if they are satisfied with the explanation.
Thanks!
On Thu, Oct 14, 2021, 7:45 AM César García Tapia @.***> wrote:
I’m closing this, because the OP solved his issue. @SpaceIm feel free to reopen it if you think it’s necessary.