[CMake] issue with INSTALL and CMAKE_INSTALL_PREFIX

Brad King brad.king at kitware.com
Thu Oct 5 09:06:56 EDT 2006


Xavier Delannoy wrote:
> SET(CMAKE_INSTALL_PREFIX "$ENV{DESTDIRPREFIX}")
> MESSAGE(STATUS "CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}")
> INSTALL(TARGETS nbase_shared DESTINATION /usr/Firewall/lib)
[snip]
> /home/xavierd/tempbuild/firmware/lib/libnbase/shared/cmake_install.cmake:30:
> FILE cannot create directory: /usr/Firewall/lib. Maybe need administrative privileges.

Read the documentation of the INSTALL command's DESTINATION option more
carefully.  A leading slash causes it to ignore the install prefix and
use the path you gave.  You want this:

INSTALL(TARGETS nbase_shared DESTINATION usr/Firewall/lib)

-Brad


More information about the CMake mailing list