qbs 1.8:从基础产品继承组

时间:2017-06-05 00:15:39

标签: qt-creator qbs

从qbs 1.5切换到1.8时出现问题。 我在'src / qbs / imports / BaseProduct.qbs'中有'BaseProduct',我在'src / derived / DerivedProduct.qbs'中有来自它的产品

在BaseProduct中我有类似的东西:

      Group {
        id: h
        name: 'h';
        Properties {
          prefix: '**/';
          files: ['*.h']
        }
      }

      Group {
        id: cpp
        name: 'cpp';
        Properties {
          prefix: '**/';
          files: ['*.cpp']
        }
      }

自动将Derived.qbs目录中的所有源添加到项目中。工作在1.5但不是1.8。 如果我添加前缀'sourceDirectory +“/”'它几乎可以工作:文件被添加到子项目,但另外分组在绝对路径下,如 '/绝对/路径/到/ SRC /子项目'。

所以项目结构得到了:

1.5,带有“前缀:'** /'”[我想要实现的目标]

DerivedProduct

     - [cpp]
       - [subdir]
         - file_from_subdir.cpp
       - file_from_root_dir.cpp

1.8,带“前缀:'** /'”[无法构建项目,因为没有添加源代码]


    - [cpp]

1.8 with“prefix:'sourceDirectory +'/ ** /'”[可以构建项目但是组中的绝对路径很难发生]

DerivedProduct

     - [cpp]
       - [/absolute/path/to/src/subproject]
         - [subdir]
           - file_from_subdir.cpp
          - file_from_src_root_dir.cpp

那么我怎样才能实现1.5 in 1.8的'auto group sources'功能,而不会将组项目复制/粘贴到每个子项目中,当然也没有绝对路径子组?

1 个答案:

答案 0 :(得分:0)

你能解释你的意思吗?"丑陋的绝对路径在群体中"?加载项目时,所有文件都被解析为绝对路径。你在谈论它是如何在Qt Creator中显示的吗?

相关问题