2009/3/18 Stephen Collyer <scoll...@netspinner.co.uk>: > 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 ?
Yes, set CMAKE_INSTALL_PREFIX to /opt (using cmake command line, ccmake ,cmake-gui etc...) when packaging RPM with CPack you should SET(CPACK_SET_DESTDIR "ON") in your CMakeLists.txt. More information on CPack RPM may be found there: http://www.vtk.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29 -- Erk _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake