I have VS2017 installed, with both VS2017 (v141) and VS2015.3 (v140) toolset installed. I need to generate a solution with CMake and I want CMake to be "fooled" as if VS2015 is installed, so I can build the project with v140 toolset.
I know this question is possibly a duplicate of:
How cmake specify "Platform Toolset" for a Visual Studio 2015 project?
But the solution it provides doesn't help me.
The error messages are:
Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.15063.
The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:18 (project):
No CMAKE_C_COMPILER could be found.
I tried installing both VS2017 and VS2015.3 (IDE), but VS2015.3 refused to create even a simple console program.
Is there another way to generate a solution with v140 toolset?
(P.S. Don't tell me that I should generate with v141 toolset first and modify the toolset option in Visual Studio. That makes a big difference. )
The CMakeSettings. json file contains information that Visual Studio uses for IntelliSense and to construct the command-line arguments that it passes to CMake for a specified configuration and compiler environment.
Just select the “Individual Components” tab at the top of the installer screen and scroll down to the “Compilers, build tools, and runtimes” section. The 14.11 toolset is included in the VS2017 version 15.5 update 4 installer.
I've just ran a test and it works for me with the following settings in CMake's GUI (Version 3.10.0 RC4):
Then I get the following output:
The CXX compiler identification is MSVC 19.0.24215.1
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Configuring done
Generating done
And if I open the resulting solution it will - as expected - ask me:
From Marco Foco: Microsoft Visual C++ version Map:
First please check the CMakeError.log
in your binary output directory. The error should give you a lead on what's wrong.
If that's not helping, you can try several things (besides re-installing VS, which I think won't solve the problem):
cmake-gui
administrative rights If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With