[CMake] CPack: how to change /usr install location ?

Stephen Collyer scollyer at netspinner.co.uk
Wed Mar 18 10:00:58 EDT 2009


I've been trying to use CPack to generate an RPM package with cmake 2.6.2.

I have the following trivial CMakeLists.txt:

############################################

PROJECT(PRINT)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

ADD_LIBRARY(print print.cpp)

SET(PRINTER_SRCS main.cpp)
ADD_EXECUTABLE(printer ${PRINTER_SRCS})
TARGET_LINK_LIBRARIES(printer print)

INSTALL(TARGETS printer print
        ARCHIVE DESTINATION print
        LIBRARY DESTINATION print
        RUNTIME DESTINATION print)

SET(CPACK_PACKAGE_NAME "print")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "print-package")
SET(CPACK_GENERATOR "RPM")
INCLUDE(CPack)

###################################

Regardless of what I put in CPACK_PACKAGE_INSTALL_DIRECTORY, the generated
rpm installs into /usr/print.

Can someone tell me what I would have to do to install into, say, /opt ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090318/461e9e26/attachment.htm>


More information about the CMake mailing list