我正在尝试通过CoApp工具为c ++构建一个nuget包。 在使用它编译cpp时,包需要嵌入3个文件夹。
所以,我想要一个内部包含结构如下:
/build/native/include/lib1,
/build/native/include/lib2,
/build/native/include/lib3
我的问题:如何在/ build / native / include /
中添加几个包含文件夹我试过了:
(不同的lib1,lib2,lib3)的多个集团:
nestedInclude +=
{
#destination = ${d_include}lib1;
".\lib1\**\*.hpp", ".\lib1\**\*.h"
};
(不同的lib1,lib2,lib3)的多个集团:
nestedInclude
{
#destination = ${d_include}lib1;
".\lib1\**\*.hpp", ".\lib1\**\*.h"
};
但似乎coapp会在集群中累积.h / .hpp文件(取决于运算符+ =与否),最后将所有这些文件添加到最后#destination
标记值。所以我得到了一个独特的条目:/build/native/include/lib3
答案 0 :(得分:4)
在您的示例中,目标会被覆盖,因此您可以在最后给定的地址中找到所有内容。要处理此问题,您可以改为创建多个嵌套包含
nested1Include: {
#destination = ${d_include}lib1;
".\lib1\**\*.hpp", ".\lib1\**\*.h"
}
nested2Include: {
#destination = ${d_include}lib2;
".\lib2\**\*.hpp", ".\lib2\**\*.h"
}
答案 1 :(得分:0)
我刚刚遇到同样的问题,而Gorgar的回答让我走上正轨,谢谢。但我还有一条额外的信息。我只有一个基础目录,在这种情况下,CoApp仍然将所有内容夷为平地。诀窍是让它认为它有两个,即使它没有,像这样:
include1: {
#destination = ${d_include}NativeLogger;
"include\NativeLogger\*.h"
};
// The use of a second include spec here which doesn't actually address any files
// is to force CoApp to create the substructure of the first include. There is some
// discussion on the net about bugginess related to includes structures, but this
// seems to fix it.
include2: { include\* };