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. How to create Project using CMake in Qt creator
Forum Updated to NodeBB v4.3 + New Features

How to create Project using CMake in Qt creator

Scheduled Pinned Locked Moved Solved General and Desktop
22 Posts 4 Posters 7.6k 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.
  • S Offline
    S Offline
    sush123
    wrote on 17 Jan 2020, 09:29 last edited by
    #1

    Hi ,

    I am trying to create project by selecting Cmake from drop down but it is not configured i have added Cmake through manage kits how can i configure this.

    Getting fallowing error
    Running C:\Program Files\CMake\bin\cmake.exe C:/Users/s28194/Documents/sample "-GCodeBlocks - Ninja" in C:\Users\s28194\Documents\build-sample-Desktop_Qt_5_14_0_MinGW_64_bit-Release.
    CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
    -- Configuring incomplete, errors occurred!

    Also tried to install Ninja https://github.com/ninja-build/ninja/releases that also did not help me.

    Please someone guide me how can i solve this.

    J K 2 Replies Last reply 17 Jan 2020, 10:07
    0
    • S sush123
      17 Jan 2020, 09:29

      Hi ,

      I am trying to create project by selecting Cmake from drop down but it is not configured i have added Cmake through manage kits how can i configure this.

      Getting fallowing error
      Running C:\Program Files\CMake\bin\cmake.exe C:/Users/s28194/Documents/sample "-GCodeBlocks - Ninja" in C:\Users\s28194\Documents\build-sample-Desktop_Qt_5_14_0_MinGW_64_bit-Release.
      CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
      -- Configuring incomplete, errors occurred!

      Also tried to install Ninja https://github.com/ninja-build/ninja/releases that also did not help me.

      Please someone guide me how can i solve this.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 17 Jan 2020, 10:07 last edited by
      #2

      @sush123 Did you try to define CMAKE_MAKE_PROGRAM so it points to make from MinGW?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • S Offline
        S Offline
        sush123
        wrote on 17 Jan 2020, 10:59 last edited by
        #3

        yes i do have MinGW

        J 1 Reply Last reply 17 Jan 2020, 11:14
        0
        • S sush123
          17 Jan 2020, 10:59

          yes i do have MinGW

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 17 Jan 2020, 11:14 last edited by
          #4

          @sush123 That's not what I mean.
          You should try to set CMAKE_MAKE_PROGRAM, so it points to make executable from MinGW.
          In QtCreator you can do it in Projects/YOUR_KIT/Build/CMake and then add this variable (or edit when already there) and set whole path to make from MinGW.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          3
          • S sush123
            17 Jan 2020, 09:29

            Hi ,

            I am trying to create project by selecting Cmake from drop down but it is not configured i have added Cmake through manage kits how can i configure this.

            Getting fallowing error
            Running C:\Program Files\CMake\bin\cmake.exe C:/Users/s28194/Documents/sample "-GCodeBlocks - Ninja" in C:\Users\s28194\Documents\build-sample-Desktop_Qt_5_14_0_MinGW_64_bit-Release.
            CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
            -- Configuring incomplete, errors occurred!

            Also tried to install Ninja https://github.com/ninja-build/ninja/releases that also did not help me.

            Please someone guide me how can i solve this.

            K Offline
            K Offline
            KroMignon
            wrote on 17 Jan 2020, 11:28 last edited by
            #5

            @sush123 Did you follow the step described in documentation?

            • Setting Up CMake
            • Build with CMake

            It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

            1 Reply Last reply
            3
            • M Offline
              M Offline
              mchinand
              wrote on 17 Jan 2020, 14:11 last edited by
              #6

              I'm not sure why it doesn't find your version of ninja. Did you restart QtCreator after installing Ninja? Make sure your CMake Generator is set properly. Tools->Kits->(Select your Kit)->CMake generator (towards the bottom). You could try switching your Generator to 'MinGW Makefiles'.

              1 Reply Last reply
              2
              • S Offline
                S Offline
                sush123
                wrote on 20 Jan 2020, 06:50 last edited by
                #7

                Can anyone help me to find Ninja setup to install.
                I tried using below link but it is disappearing after double clicking on setup file not sure why,
                https://github.com/ninja-build/ninja/releases

                J 1 Reply Last reply 20 Jan 2020, 06:55
                0
                • S sush123
                  20 Jan 2020, 06:50

                  Can anyone help me to find Ninja setup to install.
                  I tried using below link but it is disappearing after double clicking on setup file not sure why,
                  https://github.com/ninja-build/ninja/releases

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 20 Jan 2020, 06:55 last edited by
                  #8

                  @sush123 Do you really need Ninja? Make (which is part of MinGW) can compile several files in parallel.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • S Offline
                    S Offline
                    sush123
                    wrote on 20 Jan 2020, 08:55 last edited by
                    #9

                    i am not sure really need ninja or not but not able to narrow down a reason for getting error like
                    " CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
                    -- Configuring incomplete, errors occurred!?"

                    After setting CMAKE_MAKE_PROGRAM, this as well

                    J 1 Reply Last reply 20 Jan 2020, 08:56
                    0
                    • S sush123
                      20 Jan 2020, 08:55

                      i am not sure really need ninja or not but not able to narrow down a reason for getting error like
                      " CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
                      -- Configuring incomplete, errors occurred!?"

                      After setting CMAKE_MAKE_PROGRAM, this as well

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 20 Jan 2020, 08:56 last edited by jsulm
                      #10

                      @sush123 said in How to create Project using CMake in Qt creator:

                      After setting CMAKE_MAKE_PROGRAM

                      How, when and where did you set it?

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        sush123
                        wrote on 20 Jan 2020, 10:17 last edited by
                        #11

                        Created new sample project by selecting :
                        Application -> Qt Widgets Application ->build system (Cmake) in dropdown->Checked Desktop Qt 5.14.0 MinGW 64-bit.

                        I can see project created in Qt creator which is not configured warning symbol before project name.

                        J 1 Reply Last reply 20 Jan 2020, 12:29
                        0
                        • S sush123
                          20 Jan 2020, 10:17

                          Created new sample project by selecting :
                          Application -> Qt Widgets Application ->build system (Cmake) in dropdown->Checked Desktop Qt 5.14.0 MinGW 64-bit.

                          I can see project created in Qt creator which is not configured warning symbol before project name.

                          J Offline
                          J Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 20 Jan 2020, 12:29 last edited by
                          #12

                          @sush123 You need to set CMAKE_MAKE_PROGRAM in your projects Build settings: "Projects/Build & Run/YOUR_KIT/Build/CMake"

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          1
                          • S Offline
                            S Offline
                            sush123
                            wrote on 21 Jan 2020, 03:44 last edited by
                            #13

                            Yes i did that then it changed warning symbol into folder kind but then still i am getting this error :
                            Running C:\Program Files\CMake\bin\cmake.exe C:/Users/s28194/Documents/untitled4 "-GCodeBlocks - Ninja" in C:\Users\s28194\Documents\build-untitled4-Desktop_Qt_5_14_0_MinGW_64_bit-Debug.
                            CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
                            -- Configuring incomplete, errors occurred!
                            See also "C:/Users/s28194/Documents/build-untitled4-Desktop_Qt_5_14_0_MinGW_64_bit-Debug/CMakeFiles/CMakeOutput.log".
                            CMake process exited with exit code 1.

                            Also Build and run icons are disabled.

                            J 1 Reply Last reply 21 Jan 2020, 06:08
                            0
                            • S sush123
                              21 Jan 2020, 03:44

                              Yes i did that then it changed warning symbol into folder kind but then still i am getting this error :
                              Running C:\Program Files\CMake\bin\cmake.exe C:/Users/s28194/Documents/untitled4 "-GCodeBlocks - Ninja" in C:\Users\s28194\Documents\build-untitled4-Desktop_Qt_5_14_0_MinGW_64_bit-Debug.
                              CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
                              -- Configuring incomplete, errors occurred!
                              See also "C:/Users/s28194/Documents/build-untitled4-Desktop_Qt_5_14_0_MinGW_64_bit-Debug/CMakeFiles/CMakeOutput.log".
                              CMake process exited with exit code 1.

                              Also Build and run icons are disabled.

                              J Offline
                              J Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on 21 Jan 2020, 06:08 last edited by
                              #14

                              @sush123 You should not pass -GNinja to CMake

                              Other possibility would be to install Ninja and add the path to it to PATH in your projects Build settings.

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              1
                              • S Offline
                                S Offline
                                sush123
                                wrote on 21 Jan 2020, 06:14 last edited by
                                #15

                                i tried adding ninja exe path under manage kits -> Cmake -> under manual i added "pathtofindninja",
                                Still no changes,
                                i could see error symbol with "Invalid codemodel file generated by Cmake " message under projects -> Build settings

                                J 1 Reply Last reply 21 Jan 2020, 06:16
                                0
                                • S sush123
                                  21 Jan 2020, 06:14

                                  i tried adding ninja exe path under manage kits -> Cmake -> under manual i added "pathtofindninja",
                                  Still no changes,
                                  i could see error symbol with "Invalid codemodel file generated by Cmake " message under projects -> Build settings

                                  J Offline
                                  J Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on 21 Jan 2020, 06:16 last edited by
                                  #16

                                  @sush123 said in How to create Project using CMake in Qt creator:

                                  kits -> Cmake

                                  This is for CMake and not Ninja!
                                  Please add the path containing ninja.exe to PATH in your projects Build settings.

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  2
                                  • S Offline
                                    S Offline
                                    sush123
                                    wrote on 21 Jan 2020, 06:23 last edited by
                                    #17

                                    @jsulm said in How to create Project using CMake in Qt creator:

                                    PATH in

                                    im really not finding where excatly i should add this ninja exe path in project settings.

                                    J 1 Reply Last reply 21 Jan 2020, 06:27
                                    0
                                    • S sush123
                                      21 Jan 2020, 06:23

                                      @jsulm said in How to create Project using CMake in Qt creator:

                                      PATH in

                                      im really not finding where excatly i should add this ninja exe path in project settings.

                                      J Offline
                                      J Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on 21 Jan 2020, 06:27 last edited by
                                      #18

                                      @sush123 "Projects/Build & Run/YOUR_KIT/Build/Build Environment" - edit PATH variable here (append directory containing ninja.exe).

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      3
                                      • S Offline
                                        S Offline
                                        sush123
                                        wrote on 21 Jan 2020, 09:16 last edited by
                                        #19

                                        i did append path C:\Qt\Qt5.14.0\Tools\mingw730_64\bin;C:\Users\s28194\Documents\ninja.exe;C:\Users\s28194\AppData\Local\Microsoft\WindowsApps;

                                        still i have disabled icons for build and run at left bottom.

                                        J 1 Reply Last reply 21 Jan 2020, 10:04
                                        0
                                        • S sush123
                                          21 Jan 2020, 09:16

                                          i did append path C:\Qt\Qt5.14.0\Tools\mingw730_64\bin;C:\Users\s28194\Documents\ninja.exe;C:\Users\s28194\AppData\Local\Microsoft\WindowsApps;

                                          still i have disabled icons for build and run at left bottom.

                                          J Offline
                                          J Offline
                                          jsulm
                                          Lifetime Qt Champion
                                          wrote on 21 Jan 2020, 10:04 last edited by
                                          #20

                                          @sush123 said in How to create Project using CMake in Qt creator:

                                          C:\Users\s28194\Documents\ninja.exe

                                          This is wrong. In PATH you only add directories, so:

                                           C:\Qt\Qt5.14.0\Tools\mingw730_64\bin;C:\Users\s28194\Documents
                                          

                                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          1 Reply Last reply
                                          3

                                          8/22

                                          20 Jan 2020, 06:55

                                          topic:navigator.unread, 14
                                          • Login

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