简体   繁体   English

qmake :警告:没有规则使目标停止

[英]qmake : warning: No rule to make target Stop

I came across lots of similar posts, but none of them helped me.我遇到了很多类似的帖子,但没有一个对我有帮助。

I have a project which has an app and test.我有一个项目,它有一个应用程序和测试。 Both App and test depends on a common lib (which is a submodule of the app). App 和 test 都依赖于一个公共库(它是应用程序的子模块)。 Here is my project structure.这是我的项目结构。

|
|_ _Application.pro
|_ _App/app.pro
|_ _lib/lib.pro
|_ _TestSuite/
             |_ _Test.pro

#Application.pro 


TEMPLATE = subdirs
SUBDIRS +=  app \
            lib

#subdirs
lib.file = $${PWD}/lib/lib.pro
app.file = $${PWD}/App/app.pro

#dependecies
app.depends  =  lib

QMAKE_CLEAN += $${OUT_PWD}/Makefile*
#Test.pro 


TEMPLATE = subdirs
SUBDIRS +=  Test \
            lib

#subdirs
lib.file = $${PWD}/../lib/lib.pro
app.file = $${PWD}/TestSuite/Test.pro

#dependecies
Test.depends  =  lib

QMAKE_CLEAN += $${OUT_PWD}/Makefile*

The application compiles fine, but when I run make on test it throws No rule to make target lib.pro needed by Test.pro Stop error.该应用程序编译正常,但是当我在测试中运行 make 时,它​​抛出No rule to make target lib.pro required by Test.pro Stop错误。

If I copy the lib files under TestSuite then it works perfectly.如果我在 TestSuite 下复制 lib 文件,那么它可以完美运行。 So is it mandatory that subdirs should a subdirectory of the current application?那么子目录必须是当前应用程序的子目录吗?

Although I can't seem to find it in the documentation at the moment, I at least found a bug report that states that .pro files using the subdirs template should not use directories that point upward in the directory structure.虽然目前我似乎无法在文档中找到它,但我至少找到了一个错误报告,指出使用subdirs模板的 .pro 文件不应该使用在目录结构中指向上方的目录。 Your subdirs .pro file should be the root of your directory tree.您的 subdirs .pro 文件应该是您的目录树的根目录。

|
|_ _Application.pro
|_ _Test.pro
|_ _App/
        |_ _app.pro
|_ _lib/
        |_ _lib.pro

EDIT: Here's the relevant documentation stating that:编辑:这是相关文件,说明:

It is strongly recommended that you specify only paths in the current project's parent directory or its subdirectories.强烈建议您仅指定当前项目的父目录或其子目录中的路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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