Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator: How to start building multiple cmake sub-projects?
QtWS25 Last Chance

QtCreator: How to start building multiple cmake sub-projects?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
6 Posts 3 Posters 1.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.
  • A Offline
    A Offline
    Asperamanca
    wrote on 12 May 2023, 06:32 last edited by
    #1

    I have a large cmake project with multiple subprojects, among them multiple executables.

    In Visual Studio, I can multi-select projects (within a solution) and build all of them

    How do I do the same in Creator? At the moment, I have to build the first subproject, wait for it to be done, then build the next...

    J 1 Reply Last reply 12 May 2023, 07:42
    0
    • A Asperamanca
      12 May 2023, 06:32

      I have a large cmake project with multiple subprojects, among them multiple executables.

      In Visual Studio, I can multi-select projects (within a solution) and build all of them

      How do I do the same in Creator? At the moment, I have to build the first subproject, wait for it to be done, then build the next...

      J Offline
      J Offline
      J.Hilk
      Moderators
      wrote on 12 May 2023, 07:42 last edited by
      #2

      @Asperamanca how does your cmakelist file look like ?

      did you add the projects as sub directories ?
      e.g.

      add_subdirectory( project1 )
      add_subdirectory( project2 )
      add_subdirectory( project3 )
      
      target_link_libraries( project1
          PRIVATE
              project2
              project3
      )
      
      target_link_libraries( project2
          PRIVATE
              project3
      )
      

      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      A 1 Reply Last reply 12 May 2023, 07:56
      0
      • J J.Hilk
        12 May 2023, 07:42

        @Asperamanca how does your cmakelist file look like ?

        did you add the projects as sub directories ?
        e.g.

        add_subdirectory( project1 )
        add_subdirectory( project2 )
        add_subdirectory( project3 )
        
        target_link_libraries( project1
            PRIVATE
                project2
                project3
        )
        
        target_link_libraries( project2
            PRIVATE
                project3
        )
        
        A Offline
        A Offline
        Asperamanca
        wrote on 12 May 2023, 07:56 last edited by
        #3

        @J-Hilk
        The executables are added using add_executable.
        They become visible as top-level nodes in the projects tree, and I can right-click and build each of them individually.

        C 1 Reply Last reply 12 May 2023, 08:41
        0
        • A Asperamanca
          12 May 2023, 07:56

          @J-Hilk
          The executables are added using add_executable.
          They become visible as top-level nodes in the projects tree, and I can right-click and build each of them individually.

          C Offline
          C Offline
          cristian-adam
          wrote on 12 May 2023, 08:41 last edited by
          #4

          Currently you cannot do it in project outline, to select targets and then issue a Build operation for the selected targets.

          By default the all target is selected for building a project (including subprojects).

          But you can choose just to build only a selection. build-target.png

          A 1 Reply Last reply 12 May 2023, 08:50
          1
          • C cristian-adam
            12 May 2023, 08:41

            Currently you cannot do it in project outline, to select targets and then issue a Build operation for the selected targets.

            By default the all target is selected for building a project (including subprojects).

            But you can choose just to build only a selection. build-target.png

            A Offline
            A Offline
            Asperamanca
            wrote on 12 May 2023, 08:50 last edited by
            #5

            @cristian-adam
            That would be excellent. But strangely, I only see the "Details" on Windows, but not on in the Linux Environment where I would need it. There, the build steps is only one line, and instead of the "Details" button, I have a stop sign.

            (Even after restarting Creator and re-loading the project).

            Any idea?

            A 1 Reply Last reply 12 May 2023, 08:51
            0
            • A Asperamanca
              12 May 2023, 08:50

              @cristian-adam
              That would be excellent. But strangely, I only see the "Details" on Windows, but not on in the Linux Environment where I would need it. There, the build steps is only one line, and instead of the "Details" button, I have a stop sign.

              (Even after restarting Creator and re-loading the project).

              Any idea?

              A Offline
              A Offline
              Asperamanca
              wrote on 12 May 2023, 08:51 last edited by
              #6

              @Asperamanca
              Solved. Screen resolution was too small for the details window, so it didn't allow me to open it, apparently.

              1 Reply Last reply
              1
              • A Asperamanca has marked this topic as solved on 12 May 2023, 08:52

              4/6

              12 May 2023, 08:41

              • Login

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