【问题标题】:Hierarchical Header Install Scons分层标题安装 Scons
【发布时间】:2011-09-13 04:17:28
【问题描述】:

我正在将我的头文件“安装”到主包含目录,以便所有额外的 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'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\\cppunit\\TestRunner.h']: target and source lists must have same length.

有没有人有安装我的标头并保留其文件夹层次结构的秘诀?

【问题讨论】:

    标签: installation scons directory


    【解决方案1】:

    试试这个:

    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()。但是,最好明确列出来源以避免意外包含您不想要的文件。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-05
    • 2020-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-15
    相关资源
    最近更新 更多