[CMake] Install destination problem

Chris Johnson cxjohnson at gmail.com
Wed Dec 28 11:52:18 EST 2016


I've found experimentally that if the install directory exists, it works
correctly.  If it does not exist, the prefix somehow gets changed to
/usr/local.  I've not found where that's getting set yet.

Thanks for the recommendation on CACHE.

On Wed, Dec 28, 2016 at 9:46 AM, Kris Thielemans <
kris.f.thielemans at gmail.com> wrote:

> Hi
>
>
>
> My guess is that you have a local variable CMAKE_INSTALL_PREFIX being
> shadowed by the global variable. Best to add the CACHE keyword etc in your
> set statement, then there’ll be only 1 variable.
>
>
>
> Kris
>
>
>
> *From:* CMake [mailto:cmake-bounces at cmake.org] *On Behalf Of *Chris
> Johnson
> *Sent:* 27 December 2016 23:27
> *To:* cmake at cmake.org
> *Subject:* [CMake] Install destination problem
>
>
>
> In all of my CMakeLists.txt files, I include a settings file, like so:
>
>
>
> include(global_settings.cmake)
>
>
>
> Inside global_settings.cmake, I have a line like this:
>
>
>
> set( CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install )
>
>
>
> When I run "make install" on my development system, the files are
> correctly installed where I expect to find them, in a subdirectory of my
> build directory named "install".
>
>
>
> But when I tried to do the same on our production server just now, it
> tried to install the binaries into /usr/local/bin.
>
>
>
> It's as if $CMAKE_INSTALL_PREFIX did not get set.
>
>
>
> What am I doing wrong?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161228/6c18acc1/attachment.html>


More information about the CMake mailing list