Using MSVC2015 and Cmake in QtCreator
-
I want to use Cmake for a better compatibility, so I generated a new project and tried to compile and run it. Everything is fine, but when I try to run it I just get the following error: MSBUILD:-1: error: MSB1009: The project file does not exist.
I use the following software:
Qt Creator 4.6.2
Qt 5.10.1
MSVC 2015, 64 bit
Cmake 3.11.1Any help is welcome!
Thank you! -
Hi
Did you follow
http://doc.qt.io/qtcreator/creator-project-cmake.htmlnote; the integration is not great. Like adding files etc is clumsy.
-
@patman said in Using MSVC2015 and Cmake in QtCreator:
I set 'Visual Studio 2017'
@patman said in Using MSVC2015 and Cmake in QtCreator:
I use the following software: MSVC 2015
See where the problem is?
Change it to NMake Makefiles
-
Sorry for the late response!
If I use NMake Makefiles, I get the following Error:
-1: error: Failed to activate protocol version: "CMAKE_GENERATOR" is set but incompatible with configured generator value.
I changed to the MSVC 2017 toolchain and configured it the following way:
and I'm getting the same error as above.
-
I know this is an old topic. But I stumbled upon this topic multiple times, but now I got CMake in QtCreator with Visual Studio 15 2017 working. But had to change a few things.
In the Qt kit, I choose:
CMake Generator
Generator: Visual Studio 15 2017 Win 64.
Extra generator: None
Platform: empty
Toolset: emptyCMake Configuration: only CMAKE_PREFIX_PATH:STRING=%{QT:QT_INSTALL_PREFIX}, removed the others
When generating a cmake project, I have to change the resulting Build Settings (for each build configuration).
CMAKE_BUILD_TYPE: Debug
CMAKE_CONFIGURATION_TYPES: DebugBuild steps: choose "ALL_BUILD" instead of "all"
For us this resulted in a working build using msbuild, which allows us to build Wix installers etc. as well, something that cannot be done with NMake Makefiles.