2011-09-13 41 views
0

我正在将我的头文件“安装”到主要包含目录,以便所有额外的scons构建可以访问它们。分层头安装Scons

headers = ''' this.h that.h other.h dir1/other.h dir2/other.h'''.split() 
include_path = Dir('cppunit', local_env['incinstall']) 
hdr_inst = local_env.Install(include_path, headers) 
env.Alias('install_cppunittest_headers', hdr_inst) 

使用SCons似乎打平我的头布局,然后崩溃,因为有多个other.h的

Install file: "tools\CppUnitTest\src\cppunit\TestRunner.h" as "include\cppunit\TestRunner.h" 
scons: *** [include\cppunit\TestRunner.h] AssertionError : Installing source ['tools\\CppUnitTest\\src\\cppunit\\TestRunner.h', 'tools\\CppUnitTest\\src\\cppunit\\ui\\text\\TestRunner.h'] into target ['include\\cppunit\\TestRunner.h']: target and source lists must have same length. 

没有人有他们的文件夹层次结构中安装我的头配方保留吗?

回答

0

试试这个:

headers = ''' this.h that.h other.h dir1/other.h dir2/other.h'''.split() 
include_path = Dir('cppunit', local_env['incinstall']) 
hdr_inst = [local_env.Install(include_path+'/'+h, h) for h in headers] 
env.Alias('install_cppunittest_headers', hdr_inst) 
+0

有没有办法用内置的水珠()函数来做到这一点?或者基本上不必手动指定标题? –

+0

绝对可以使用Glob()。但是,最好的做法是明确列出来源,以避免意外地包含您不想要的文件。 – bdbaddog