如何在不运行configure脚本/ cmake的情况下修改安装路径 [英] how to modify the install-path without running the configure script/cmake again

查看:471
本文介绍了如何在不运行configure脚本/ cmake的情况下修改安装路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要大量时间(10-15分钟)构建的项目。我已经重新编译,以验证是否存在编译错误。现在我想更改安装目录,以便我有一个新版本的可执行文件与新的更改。是否有一种方法只是修改安装路径,使make install安装到新位置而不是旧位置?

I am working on a project which takes considerable time to build (10-15) minutes. I have recompiled to verify if there is a compilation error. Now I want to change the install directory so that I have a new version of executable with the new changes. Is there a method to just modify the install path so that the 'make install' installs to a new location rather than the old one?

推荐答案

CMake生成的makefile支持makefiles的 DESTDIR编码约定。因此,您可以通过在调用make时设置 DESTDIR 变量来覆盖默认安装位置:

CMake generated makefiles support the DESTDIR coding convention for makefiles. Thus you can override the default installation location by setting the DESTDIR variable upon invoking make:

$ make install DESTDIR=/opt/local

无需重新运行CMake。

There is no need to re-run CMake.

这篇关于如何在不运行configure脚本/ cmake的情况下修改安装路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆