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] Setting CMAKE_TOOLCHAIN_FILE to conan_toolchain.cmake make vscode-cmake-tool not work.

See original GitHub issue

I use VSCode to write a executable. And I use CMakeDeps and CMakeToolchain generators. After setting CMAKE_TOOLCHAIN_FILE to conan_toolchain.cmake, the command CMake: Run Without Debuging does not work. I have no idea it’s due to Conan or vscode-cmake-tool. But when removing CMAKE_TOOLCHAIN_FILE, everything works fine.

Environment Details (include every applicable attribute)

  • Operating System+version: Ubuntu 22.04 (docker)
  • Compiler+version: g++ 11.2
  • Conan version: 1.47
  • Python version: 3.10

Steps to reproduce (Include if Applicable)

  1. Start a new docker and use VSCode to open it.
  2. Start a new project with conan and with CMakeDeps and CMakeToolchain generators.
  3. Set CMAKE_TOOLCHAIN_FILE to conan_toolchain.cmake above project(demo) (using cmake_kits.json is the same).
  4. Put find_package(something REQUIRED) to CMakeLists.txt and it can compile with CMake: Build but CMake: Run Without Debuging.

Logs (Executed commands with output) (Include/Attach if Applicable)

No log

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
memshardedcommented, May 5, 2022

Yes, these integrations are relatively stable now, but still experimental, it is expected that they keep improving from release to release, fixing bugs, etc., but might not get backports patches to older releases, because that experimental status.

0reactions
Kidsunbocommented, May 5, 2022

Hi @memsharded I found that with Conan 1.48, cmake tools for VSCode works perfectly even though it still doesn’t work with Conan 1.47. But it’s enough that it works with newer version. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Kit with toolchainFile fails to determine CMAKE_(C|CXX)_ ...
Brief Issue Summary A local user CMake kit using a toolchainFile will make cmake-tools fail at determining the C/C++ compiler path.
Read more >
setting toolchain file in visual studio code and cmake tool for ...
but when I run cmake, I am getting this error: [main] Building folder: cmakeTest [main] Configuring folder: cmakeTest [proc] Executing ...
Read more >
cmake-toolchains(7) — CMake 3.25.1 Documentation
CMake uses a toolchain of utilities to compile, link libraries and create ... Running CMake without specifying CMAKE_SYSTEM_NAME will run the configure step ......
Read more >
CMakeToolchain — conan 1.46.2 documentation
For settings.compiler="Visual Studio" , the CMake generator is a direct mapping of compiler.version , as this version represents the IDE version, not the ......
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