[CMake] How can I install something into an absolute directory?

Andreas Pakulat apaku at gmx.de
Mon Feb 16 08:57:58 EST 2009


On 16.02.09 21:12:46, Kermit Mei wrote:
> How can I install something into an absolute directory?
> For example, I want to install the directory under /usr/share.
> When I use the following command:
> INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/dict/mydir DESTINATION share)
>
> 'mydir' may be installed into /usr/local/share, if I run
> cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..

Thats correct and the right thing to happen.

> How to avoid it, and guarantee it can be install under /usr/share  
> whatevery I
> pointed with cmake PREFIX ?

Your app should not need that, in particular nothing that builds from
source should install into a directory thats controlled by a distributions
packaging system. Apart from that, something like this would probably break
how distributions build a package from such sources.

Can you explain why you think you need this?

Andreas

-- 
Good day to let down old friends who need help.


More information about the CMake mailing list