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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #1
    This post is deleted!
    jsulmJ J.HilkJ 2 Replies Last reply
    0
    • J.HilkJ J.Hilk

      @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

      SPlattenS Offline
      SPlattenS Offline
      SPlatten
      wrote on last edited by SPlatten
      #16
      This post is deleted!
      1 Reply Last reply
      0
      • SPlattenS SPlatten

        This post is deleted!

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @SPlatten What build system is used for this projects?

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

        SPlattenS 1 Reply Last reply
        0
        • SPlattenS SPlatten

          This post is deleted!

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #3

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


          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.

          SPlattenS 1 Reply Last reply
          2
          • jsulmJ jsulm

            @SPlatten What build system is used for this projects?

            SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by
            #4
            This post is deleted!
            jsulmJ 1 Reply Last reply
            0
            • SPlattenS SPlatten

              This post is deleted!

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #5

              @SPlatten So, it is a QMake based project: follow what @J-Hilk suggested.

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

              1 Reply Last reply
              0
              • J.HilkJ J.Hilk

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

                SPlattenS Offline
                SPlattenS Offline
                SPlatten
                wrote on last edited by
                #6
                This post is deleted!
                jsulmJ J.HilkJ 2 Replies Last reply
                0
                • SPlattenS SPlatten

                  This post is deleted!

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 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
                  • SPlattenS SPlatten

                    This post is deleted!

                    J.HilkJ Offline
                    J.HilkJ Offline
                    J.Hilk
                    Moderators
                    wrote on 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.

                    SPlattenS 1 Reply Last reply
                    2
                    • J.HilkJ J.Hilk

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

                      SPlattenS Offline
                      SPlattenS Offline
                      SPlatten
                      wrote on last edited by
                      #9
                      This post is deleted!
                      jsulmJ J.HilkJ 2 Replies Last reply
                      0
                      • SPlattenS SPlatten

                        This post is deleted!

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on 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

                        SPlattenS 1 Reply Last reply
                        0
                        • jsulmJ jsulm

                          @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

                          SPlattenS Offline
                          SPlattenS Offline
                          SPlatten
                          wrote on last edited by
                          #11
                          This post is deleted!
                          jsulmJ 1 Reply Last reply
                          0
                          • SPlattenS SPlatten

                            This post is deleted!

                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 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
                            • SPlattenS SPlatten

                              This post is deleted!

                              J.HilkJ Offline
                              J.HilkJ Offline
                              J.Hilk
                              Moderators
                              wrote on 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.

                              SPlattenS 1 Reply Last reply
                              1
                              • J.HilkJ J.Hilk

                                @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

                                SPlattenS Offline
                                SPlattenS Offline
                                SPlatten
                                wrote on last edited by
                                #14
                                This post is deleted!
                                J.HilkJ 1 Reply Last reply
                                0
                                • SPlattenS SPlatten

                                  This post is deleted!

                                  J.HilkJ Offline
                                  J.HilkJ Offline
                                  J.Hilk
                                  Moderators
                                  wrote on 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.

                                  SPlattenS 2 Replies Last reply
                                  0
                                  • J.HilkJ J.Hilk

                                    @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

                                    SPlattenS Offline
                                    SPlattenS Offline
                                    SPlatten
                                    wrote on last edited by SPlatten
                                    #16
                                    This post is deleted!
                                    1 Reply Last reply
                                    0
                                    • J.HilkJ J.Hilk

                                      @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

                                      SPlattenS Offline
                                      SPlattenS Offline
                                      SPlatten
                                      wrote on 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