-
Notifications
You must be signed in to change notification settings - Fork 992
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] Visual Studio 2022 (17.12.3) for opening a CMake project #17574
Comments
Hi @schwaerz Thanks for your report. I am not sure what could be failing. |
Hello, I am encountering the exact same issue. Here is the full log, ran from powershell 7: Click to expand log(venv) PS C:\Users\Todiq\Documents\CAST\basetest> cmake --version
cmake version 3.31.4
CMake suite maintained and supported by Kitware (kitware.com/cmake).
(venv) PS C:\Users\Todiq\Documents\CAST\basetest> conan version
version: 2.11.0
conan_path: C:\Users\Todiq\Documents\CAST\venv\Scripts\conan
python
version: 3.9.13
sys_version: 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)]
sys_executable: C:\Users\Todiq\Documents\CAST\venv\Scripts\python.exe
is_frozen: False
architecture: AMD64
system
version: 10.0.26100
platform: Windows-10-10.0.26100-SP0
system: Windows
release: 10
cpu: Intel64 Family 6 Model 186 Stepping 3, GenuineIntel
(venv) PS C:\Users\Todiq\Documents\CAST\basetest> conan install -pr:a msvc .
======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=194
os=Windows
[conf]
tools.cmake.cmake_layout:build_folder_vars=['settings.os', 'settings.compiler', 'settings.compiler.version', 'settings.arch']
tools.cmake.cmaketoolchain:generator=Ninja Multi-Config
tools.env.virtualenv:powershell=pwsh
Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=194
os=Windows
[conf]
tools.cmake.cmake_layout:build_folder_vars=['settings.os', 'settings.compiler', 'settings.compiler.version', 'settings.arch']
tools.cmake.cmaketoolchain:generator=Ninja Multi-Config
tools.env.virtualenv:powershell=pwsh
======== Computing dependency graph ========
Graph root
conanfile.py (castbasetest/0.1): C:\Users\Todiq\Documents\CAST\basetest\conanfile.py
======== Computing necessary packages ========
======== Installing packages ========
======== Finalizing install (deploy, generators) ========
conanfile.py (castbasetest/0.1): Calling generate()
conanfile.py (castbasetest/0.1): Generators folder: C:\Users\Todiq\Documents\CAST\basetest\build\windows-msvc-194-x86_64\generators
conanfile.py (castbasetest/0.1): CMakeToolchain generated: conan_toolchain.cmake
conanfile.py (castbasetest/0.1): CMakeToolchain: Preset 'conan-windows-msvc-194-x86_64' added to CMakePresets.json.
(cmake>=3.23) cmake --preset conan-windows-msvc-194-x86_64
(cmake<3.23) cmake <path> -G "Ninja Multi-Config" -DCMAKE_TOOLCHAIN_FILE=generators\conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW
conanfile.py (castbasetest/0.1): CMakeToolchain generated: C:\Users\Todiq\Documents\CAST\basetest\build\windows-msvc-194-x86_64\generators\CMakePresets.json
conanfile.py (castbasetest/0.1): CMakeToolchain generated: C:\Users\Todiq\Documents\CAST\basetest\CMakeUserPresets.json
conanfile.py (castbasetest/0.1): Generating aggregated env files
conanfile.py (castbasetest/0.1): Generated aggregated env files: ['conanbuild.bat', 'conanbuild.ps1', 'conanrun.ps1']
Install finished successfully
(venv) PS C:\Users\Todiq\Documents\CAST\basetest> cmake --list-presets
Available configure presets:
"conan-windows-msvc-194-x86_64" - 'conan-windows-msvc-194-x86_64' config
(venv) PS C:\Users\Todiq\Documents\CAST\basetest> cmake --preset conan-windows-msvc-194-x86_64
Preset CMake variables:
CMAKE_POLICY_DEFAULT_CMP0091="NEW"
CMAKE_TOOLCHAIN_FILE:FILEPATH="generators\conan_toolchain.cmake"
-- Using Conan toolchain: C:/Users/Rodolphe/Documents/CAST/basetest/build/windows-msvc-194-x86_64/generators/conan_toolchain.cmake
-- Conan toolchain: Setting CMAKE_MSVC_RUNTIME_LIBRARY=$<$<CONFIG:Release>:MultiThreadedDLL>
-- Conan toolchain: C++ Standard 17 with extensions OFF
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The CXX compiler identification is MSVC 19.42.34436.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (5.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/Rodolphe/Documents/CAST/basetest/build/windows-msvc-194-x86_64
(venv) PS C:\Users\Todiq\Documents\CAST\basetest> I tried your solution @memsharded, but that didn't help. Updating VS from 17.12.3 to 17.12.4 didn't do much either. |
Thanks very much @Todiq for the feedback. |
Yes, I can confirm that it works on the command line. Hope that this was not changed on purpose in VS. |
If anyone reports or finds any relevant link in VS issue trackers, please link it here for others to follow. |
What is your question?
Hi,
I wanted to use Visual Studio 2022 (v 17.12.3) for building a Conan project using the CMake generator. I am stuck with the following error message seen in Visual Studio:
I think to remember that this used to work. However it does not.
I wonder whether I am doing something wrong, or whether this is bug or incompatibilty with / between Visual Studio and Conan?
I used Conan 2.10.1, CMake 3.31.7.
The relevant part in the conanfile looks like this:
For generating the cmake preset, I am using the following commands:
If I rename
CMakeUserPresets.json
toCMakePresets.json
Visual Studio seems to be happy. However, according to the Conan documentation I'd have expected this to work.Probably I am missing something?
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: