[CMake] Proper behaviour and use of CMAKE_INSTALL_* variables

Andreas Pakulat apaku at gmx.de
Mon Dec 9 10:52:18 EST 2013


Hi,

On Mon, Dec 9, 2013 at 3:50 PM, Mojca Miklavec <
mojca.miklavec.lists at gmail.com> wrote:

> Dear list members,
>
> I often like or need to install two versions of the same software.
> Ideally the software should put its files by default to
>     $prefix/include/$NAME/*.h
>     $prefix/lib/$NAME/*.dylib
>     ...
> ($prefix => $CMAKE_INSTALL_PREFIX)
>
> and in order to be able to install multiple versions side-by-side I
> would like to be able to specify something like
>     -DCMAKE_INSTALL_INCLUDEDIR=include/$NAME/$VERSION
>     -DCMAKE_INSTALL_LIBDIR=lib/$NAME/$VERSION
> to end up with
>     $prefix/include/$NAME/$VERSION/*.h
>     $prefix/lib/$NAME/$VERSION/*.dylib
> instead of default paths.
>

Do you have any reasons that speak against using separate prefixes for each
version of that software? In particular since such a setup will make your
life harder when you want to use the installed software in some cmake-based
project. In that case you'd have to manually specify include-dir and
lib-dir when configuring the project since many find-modules simply expect
a 'standard' unix-like layout below the prefix under which they should
search for a given software. So they don't look into include/<version> or
lib/<version> so you'd need to specify that manually. Compared with the
ease of just specifying CMAKE_PREFIX_PATH to the installation directory for
the version you want thats a lot more effort each time you setup a build
directory.

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20131209/96e7fc3b/attachment.htm>


More information about the CMake mailing list