Installation 分层标头安装SCON

Installation 分层标头安装SCON,installation,scons,directory,Installation,Scons,Directory,我正在将我的头文件“安装”到主include目录,以便所有额外的scon构建都可以访问它们 差不多 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_c

我正在将我的头文件“安装”到主include目录,以便所有额外的scon构建都可以访问它们

差不多

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似乎压扁了我的标题布局,然后崩溃,因为还有多个其他的.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.
是否有人有办法在保留文件夹层次结构的情况下安装my Header?

试试以下方法:

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)

有没有办法使用内置的Glob()函数来实现这一点?或者基本上不需要手动指定标题?当然可以使用Glob()。但是,更好的做法是明确列出源代码,以避免意外地包含您不打算包含的文件。