使用 cmake 不同的安装目标
我有一个由三个二进制文件和两个库组成的项目。今天,我每个部分都有 2 个 CMakeLists.txt 文件,因为我希望 make install
将编译后的文件复制到 project/bin 目录以供开发和生产使用,我希望它将文件安装到 < code>/usr/...
我想要一个单独的 make install-dev
和 make install
或类似的东西。用cmake可以吗?我在 cmake 文档中搜索但没有找到相关内容。
I have a project consisting of three binaries and two libraries. Today I have 2 CMakeLists.txt files for each part, because I want make install
to copy the compiled files to the project/bin directory for development and for production use I want it to install the files to /usr/
...
I would like to have a separate make install-dev
and make install
or something like that. Is that possible with cmake? I searched in the cmake docs but found nothing relevant.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道移动安装点的最简单方法是使用安装目录的相对路径
,然后当您运行 cmake 进行开发时,像这样运行它
以进行发布
The easiest way I know of to move the install point is to use relative paths for your install directories
and then when you run cmake for development run it like this
for release like this