how to modify the install-path without running the configure script/cmake again

A. K. picture A. K. · Nov 20, 2012 · Viewed 39k times · Source

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?

Answer

sakra picture sakra · Nov 21, 2012

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

There is no need to re-run CMake.