[CMake] INSTALL destination directories

Andreas Pakulat apaku at gmx.de
Wed Nov 14 15:31:57 EST 2007


On 14.11.07 20:19:38, Stephen Collyer wrote:
> This is an INSTALL example copied from the wiki:
> 
> INSTALL(TARGETS ExecutableTarget StaticLibraryTarget SharedLibraryTarget
>   RUNTIME DESTINATION bin
>   LIBRARY DESTINATION lib
>   ARCHIVE DESTINATION lib
> )
> 
> 1. I assume that cmake automatically knows (somehow) to associate
> ExecutableTarget with the RUNTIME DESTINATION and similarly for
> the library targets. Is that right ?

Right, it uses the information gathered when you called add_executable
or add_library. That is, add_executable will create a target for an
executable binary which gets installed into RUNTIME.

> 2. I guess the bin and lib directories are relative to something,
> but it's not clear to me what that place is. Is it the directory
> where the topmost CMakeList.txt file lives ?

CMAKE_INSTALL_PREFIX is used as base. Unfortunately the cmake manpage
lacks a tad bit there, as it only talks about installing into
<prefix>/lib and <prefix>/bin in the section about "install". However
the old and deprecated commands INSTALL_TARGETS, INSTALL_FILES and so on
have a link between installation prefix and the variable thats actually
used for it.

Andreas

-- 
Everything that you know is wrong, but you can be straightened out.


More information about the CMake mailing list