question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] CMakeToolchain: don't set CMAKE_GENERATOR_PLATFORM if Visual Studio xx yyyy arch

See original GitHub issue

Environment 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 and Visual 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kenfredcommented, Oct 14, 2021

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:

@kenfred https://github.com/kenfred did @memsharded https://github.com/memsharded’s answer solve your problem? Please close this issue if it did.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/conan-io/conan/issues/9761#issuecomment-943373165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJYXKAXUUHQE4BAJRYQGETUG3NGVANCNFSM5FST3WJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

0reactions
tapiacommented, Oct 20, 2021

I’m closing this, because the OP solved his issue. @SpaceIm feel free to reopen it if you think it’s necessary.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found