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
QtWS25 Last Chance

Using MSVC2015 and Cmake in QtCreator

Scheduled Pinned Locked Moved Unsolved General and Desktop
cmakemsvcqtcreator
9 Posts 5 Posters 9.4k Views
  • 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 11 Jun 2018, 19:23 last edited by patman 6 Nov 2018, 19:26
    #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
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 11 Jun 2018, 21:00 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 12 Jun 2018, 05:12 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
        • V Offline
          V Offline
          VRonin
          wrote on 12 Jun 2018, 14:19 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 15 Jun 2018, 13:52 last edited by
            #5

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

            V 1 Reply Last reply 15 Jun 2018, 13:55
            0
            • P patman
              15 Jun 2018, 13:52

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

              V Offline
              V Offline
              VRonin
              wrote on 15 Jun 2018, 13:55 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 24 Jun 2018, 14:30 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 12 Nov 2018, 13:36 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
                  • C Offline
                    C Offline
                    Crawl.W
                    wrote on 27 Aug 2020, 06:03 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