Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using MSVC2015 and Cmake in QtCreator
Forum Updated to NodeBB v4.3 + New Features

Using MSVC2015 and Cmake in QtCreator

Scheduled Pinned Locked Moved Unsolved General and Desktop
cmakemsvcqtcreator
9 Posts 5 Posters 9.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    patman
    wrote on last edited by patman
    #1

    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.1

    Any help is welcome!
    Thank you!

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Did you follow
      http://doc.qt.io/qtcreator/creator-project-cmake.html

      note; the integration is not great. Like adding files etc is clumsy.

      1 Reply Last reply
      2
      • P Offline
        P Offline
        patman
        wrote on last edited by
        #3

        Yes, I did follow these instructions :/
        I'll check the settings again...
        EDIT: if I use the MinGW 32Bit Compiler, everything is fine.

        1 Reply Last reply
        1
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          What do you have under "CMake Generator" in the kits tab?

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          3
          • P Offline
            P Offline
            patman
            wrote on last edited by
            #5

            I set 'Visual Studio 15 2017' as the Cmake generator. No platform and toolset.

            VRoninV 1 Reply Last reply
            0
            • P patman

              I set 'Visual Studio 15 2017' as the Cmake generator. No platform and toolset.

              VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by VRonin
              #6

              @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

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              1 Reply Last reply
              2
              • P Offline
                P Offline
                patman
                wrote on last edited by patman
                #7

                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:

                0_1529850422844_CMake_Configuration.PNG

                and I'm getting the same error as above.

                1 Reply Last reply
                0
                • E Offline
                  E Offline
                  escyll
                  wrote on last edited by
                  #8

                  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: empty

                  CMake 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: Debug

                  Build 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.

                  1 Reply Last reply
                  3
                  • Crawl.WC Offline
                    Crawl.WC Offline
                    Crawl.W
                    wrote on last edited by
                    #9

                    在Qt Creator中,项目->Build,Build的步骤修改Target为Current executable。

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved