c++ - 使用 automake 安装 header

标签 c++ autotools automake

我正在编写一个使用 autotools 进行编译/安装的库。我的目录树有点像这样

/src/
    file1.cpp
    file2.cpp
/include/
    dir/
        header1.hpp
        header2.hpp
        subdir/
            header.hpp
configure.ac
Makefile.am

我想在 $(includedir)/subdir/ 中的 include/subdir/* 中安装 header 。我怎么做?不,递归生成文件不是一种选择。递归 Make 被认为是有害的。 http://miller.emu.id.au/pmiller/books/rmch/

最佳答案

尝试:

subdirheadersdir = $(includedir)/subdir
subdirheaders_HEADERS = include/subdir/header.hpp

请注意,您不能使用通配符(如 include/subdir/*.hpp)。您必须列出所有文件。此外,subdirheaders 只是一个示例名称。您可以使用任何您想要的。

关于c++ - 使用 automake 安装 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13088672/

相关文章:

c - 在 Makefile.am(automake) 中使用 if 语句

c - 如何避免重新定义 VERSION、PACKAGE 等

c++ - vector 的访问 vector <double*>

c++ - bool 类型的按位运算和逻辑运算相同吗?

c++ - C-like、构造函数和统一初始化之间有什么区别?

testing - 执行子目录中的所有测试,即使某些测试失败

c++ - 获取距离中心矩形最远的矩形

c - 如何在 AC_COMPILE_IFELSE 程序中使用 AC_CHECK_HEADER header

c - 如何在 Makefile.am 中使用条件

c++ - 如何修复 Makefile.am asterisk-Cpp : C++ Static Library 中的错误