开发者

Hierarchical Header Install Scons

开发者 https://www.devze.com 2023-04-04 23:04 出处:网络
I am \'installing\' my header files to the main include directory for all the extra scons builds to have access to them.

I am 'installing' my header files to the main include directory for all the extra scons builds to have access to them.

something like

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 seems to flatten my header layout and then crashes as there are multiple other.h's

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\\cp开发者_开发百科punit\\TestRunner.h']: target and source lists must have same length.

Does anyone have a recipe for installing my headers with their folder hierarchy preserved?


Try this:

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号