[CMake] Setting up standard library output directory

Michael Wild themiwi at gmail.com
Sun Jul 4 05:29:31 EDT 2010


On Sat, Jul 3, 2010 at 11:34 PM, Michael Jackson <
mike.jackson at bluequartz.net> wrote:

> That cmake variable controls where the compiled library will be placed
> during the compilation process not the install process. You will
> probably have to use the "install" command to tell cmake that you want
> your libraries installed in lib64 instead of lib.
>
> -----
> Mike Jackson                      www.bluequartz.net
> Principal Software Engineer       mike.jackson at bluequartz.net
> BlueQuartz Software               Dayton, Ohio
>
> On Jul 3, 2010, at 9:46, Enno Fennema <e.fennema at tiscali.nl> wrote:
>
> > I am totally new to cmake and struggling.
> >
> > cmake-gui tells me at the end of a Configure
> > that libraries will be installed to /usr/local/lib rather than
> > /usr/local/lib64 where theu should go.
> >
> > I have added using cmake-gui first try
> >    CMAKE_OUTPUT_LIBRARY_DIRECTORY=/usr/local/lib64
> > and next try
> >    LIBRARY_OUTPUT_DIRECTORY=/usr/local/lib64
> > but cmake-gui keeps telling me
> >    --   libraries will be installed at: /usr/local/lib
> >
> > What do I change where and how to get the desired behaviour?
> >
> > Thanks for any help.
> > Enno
>

Although, installing in /usr/lib64 is only a convention . E.g. Debian
doesn't do it (/usr/lib64 is just a symlink to /usr/lib on 64 bit sytems).
You should leave that choice to your users, by e.g. doing this:

set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
set(INSTALL_INC_DIR include CACHE PATH "Installation directory for headers")
set(INSTALL_DATA_DIR share/${PROJECT_NAME} CACHE PATH "Installation
directory for data files")

This way you provide reasonable defaults (all of them are relative to
CMAKE_INSTALL_PREFIX), but the user can customize them.

HTH

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100704/6a86dc49/attachment.htm>


More information about the CMake mailing list