Hierarchical Header Install Scons
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)
精彩评论