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. Qt Creator configure to open multiple projects in one project ?
Forum Updated to NodeBB v4.3 + New Features

Qt Creator configure to open multiple projects in one project ?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
17 Posts 3 Posters 1.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.
  • J J.Hilk
    14 Oct 2022, 11:19

    @SPlatten
    qmake has the TEMPLATE = subdirs to add multiple projects into one project umbrella
    cmake has, afaik, add_subdirectory() to do the same/similar

    S Offline
    S Offline
    SPlatten
    wrote on 14 Oct 2022, 11:37 last edited by
    #6
    This post is deleted!
    J J 2 Replies Last reply 14 Oct 2022, 11:38
    0
    • S SPlatten
      14 Oct 2022, 11:37

      This post is deleted!

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 14 Oct 2022, 11:38 last edited by
      #7

      @SPlatten said in Qt Creator configure to open multiple projects in one project ?:

      How do I use add_subdirectory() in the pro file ?

      You don't - it is for CMake.
      Simply open your top level pro file with TEMPLATE = subdirs.

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

      1 Reply Last reply
      1
      • S SPlatten
        14 Oct 2022, 11:37

        This post is deleted!

        J Offline
        J Offline
        J.Hilk
        Moderators
        wrote on 14 Oct 2022, 11:41 last edited by
        #8

        @SPlatten add_subdirectory() is cmake only, you're using pro files -> qmake as build system

        make a new pro file, make it TEMPLATE = subdirs

        add your sub dirs:

        SUBDIRS =   MainApplication \
                    ThCommunication
        

        specify the path, if needed:

        MainApplication.subdir = MainApplication
        ThCommunication.subdir = Dependencies/ThCommunication
        

        specify dependencies, for example if you need the library before linking of your main application:

        MainApplication.depends = ThCommunication
        

        be aware, your pro file of your subprojects should have the same name as the folder it lives in. I haven't yet found a way around this restriction.


        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.

        S 1 Reply Last reply 14 Oct 2022, 11:59
        2
        • J J.Hilk
          14 Oct 2022, 11:41

          @SPlatten add_subdirectory() is cmake only, you're using pro files -> qmake as build system

          make a new pro file, make it TEMPLATE = subdirs

          add your sub dirs:

          SUBDIRS =   MainApplication \
                      ThCommunication
          

          specify the path, if needed:

          MainApplication.subdir = MainApplication
          ThCommunication.subdir = Dependencies/ThCommunication
          

          specify dependencies, for example if you need the library before linking of your main application:

          MainApplication.depends = ThCommunication
          

          be aware, your pro file of your subprojects should have the same name as the folder it lives in. I haven't yet found a way around this restriction.

          S Offline
          S Offline
          SPlatten
          wrote on 14 Oct 2022, 11:59 last edited by
          #9
          This post is deleted!
          J J 2 Replies Last reply 14 Oct 2022, 12:01
          0
          • S SPlatten
            14 Oct 2022, 11:59

            This post is deleted!

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 14 Oct 2022, 12:01 last edited by
            #10

            @SPlatten said in Qt Creator configure to open multiple projects in one project ?:

            example_project.subdir = ../example_project/

            Is your example_project really one level up?!
            Usually such projects are structured like shown here: https://wiki.qt.io/SUBDIRS_-_handling_dependencies

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

            S 1 Reply Last reply 14 Oct 2022, 12:03
            0
            • J jsulm
              14 Oct 2022, 12:01

              @SPlatten said in Qt Creator configure to open multiple projects in one project ?:

              example_project.subdir = ../example_project/

              Is your example_project really one level up?!
              Usually such projects are structured like shown here: https://wiki.qt.io/SUBDIRS_-_handling_dependencies

              S Offline
              S Offline
              SPlatten
              wrote on 14 Oct 2022, 12:03 last edited by
              #11
              This post is deleted!
              J 1 Reply Last reply 14 Oct 2022, 12:05
              0
              • S SPlatten
                14 Oct 2022, 12:03

                This post is deleted!

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 14 Oct 2022, 12:05 last edited by
                #12

                @SPlatten said in Qt Creator configure to open multiple projects in one project ?:

                however I could move it up ?

                Sure you can.
                Check the path in the error you get - is it what it should be? Is there a pro file in that folder?

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

                1 Reply Last reply
                0
                • S SPlatten
                  14 Oct 2022, 11:59

                  This post is deleted!

                  J Offline
                  J Offline
                  J.Hilk
                  Moderators
                  wrote on 14 Oct 2022, 12:05 last edited by J.Hilk
                  #13

                  @SPlatten said in Qt Creator configure to open multiple projects in one project ?:

                  I think I've done something wrong:

                  first of all, remove this
                  CONFIG += ordered
                  or I will start murdering puppies!

                  it is named subdir for a reason, iirc .. is not supported. And I'm almost certain that _PRO_FILE_ doesn't work either, as a SUBDIR property

                  your pro file has already the same name as the directory it is in, so you're fine in that regard


                  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.

                  S 1 Reply Last reply 14 Oct 2022, 12:13
                  1
                  • J J.Hilk
                    14 Oct 2022, 12:05

                    @SPlatten said in Qt Creator configure to open multiple projects in one project ?:

                    I think I've done something wrong:

                    first of all, remove this
                    CONFIG += ordered
                    or I will start murdering puppies!

                    it is named subdir for a reason, iirc .. is not supported. And I'm almost certain that _PRO_FILE_ doesn't work either, as a SUBDIR property

                    your pro file has already the same name as the directory it is in, so you're fine in that regard

                    S Offline
                    S Offline
                    SPlatten
                    wrote on 14 Oct 2022, 12:13 last edited by
                    #14
                    This post is deleted!
                    J 1 Reply Last reply 14 Oct 2022, 12:17
                    0
                    • S SPlatten
                      14 Oct 2022, 12:13

                      This post is deleted!

                      J Offline
                      J Offline
                      J.Hilk
                      Moderators
                      wrote on 14 Oct 2022, 12:17 last edited by J.Hilk
                      #15

                      @SPlatten said in Qt Creator configure to open multiple projects in one project ?:

                      /home/.../example_project/

                      soo, what's the content of this folder ? can you check, that there is a example_project.pro in it?

                      remove the trailing /
                      ./.../example_project/ -> ./.../example_project


                      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.

                      S 2 Replies Last reply 14 Oct 2022, 12:22
                      0
                      • J J.Hilk
                        14 Oct 2022, 12:17

                        @SPlatten said in Qt Creator configure to open multiple projects in one project ?:

                        /home/.../example_project/

                        soo, what's the content of this folder ? can you check, that there is a example_project.pro in it?

                        remove the trailing /
                        ./.../example_project/ -> ./.../example_project

                        S Offline
                        S Offline
                        SPlatten
                        wrote on 14 Oct 2022, 12:22 last edited by SPlatten
                        #16
                        This post is deleted!
                        1 Reply Last reply
                        0
                        • J J.Hilk
                          14 Oct 2022, 12:17

                          @SPlatten said in Qt Creator configure to open multiple projects in one project ?:

                          /home/.../example_project/

                          soo, what's the content of this folder ? can you check, that there is a example_project.pro in it?

                          remove the trailing /
                          ./.../example_project/ -> ./.../example_project

                          S Offline
                          S Offline
                          SPlatten
                          wrote on 13 Jan 2023, 10:00 last edited by
                          #17

                          @J-Hilk , sorry to do this, can you please delete any posts where you have quoted my text or edit to remove quoted text. I am in trouble as I have mentioned project names in my posts that I should not have and as a result my contract has been terminated.

                          Thank you,
                          Simon

                          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