简体   繁体   中英

Include a qmake project in another qmake project

I have created an application in qt/c++

Browser/Browser.pro

To start the browser, I need an agent. I have created an agent and store it in the Browser folder

Browser/Browser.pro
        Browser.cpp
        main.cpp
        Agent/Agent.pro
        Agent/agent.cpp

When building the Browser, I'm generating an app but it's only build the browser.

I have added in Browser.pro the line below:

SUBDIRS += \
  Agent/Agent.pro

browser.depend = Agent/Agent.pro

My concerns is that I'm trying to build browser.app and automatically agent.app . The goal after is to integrate the the agent.app generated in the resource of the browser.app

Any idea

SUBDIRS variable is only interpreted in TEMPLATE=subdirs pro file. Also, it does take only the directory name where to find your project, not the .pro itself.

You should create a directory for your Browser project and get this:

Browser/
       |-Browser.pro
       |-Browser/
                |-Browser.pro
                |- ...
       |-Agent/
              |-Agent.pro
              |- ...

And then your main project file will be like this:

Browser.pro:

    TEMPLATE = subdirs
    SUBDIRS = Agent Browser
    CONFIG += ordered

More information about subdirs : http://doc.qt.io/qt-5/qmake-variable-reference.html#subdirs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM