[bug] Setting CMAKE_TOOLCHAIN_FILE to conan_toolchain.cmake make vscode-cmake-tool not work.
See original GitHub issueI 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)
- Start a new docker and use VSCode to open it.
- Start a new project with conan and with
CMakeDeps
andCMakeToolchain
generators. - Set
CMAKE_TOOLCHAIN_FILE
toconan_toolchain.cmake
aboveproject(demo)
(usingcmake_kits.json
is the same). - Put
find_package(something REQUIRED)
toCMakeLists.txt
and it can compile withCMake: Build
butCMake: Run Without Debuging
.
Logs (Executed commands with output) (Include/Attach if Applicable)
No log
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top 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 >
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
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.
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.