2011/11/1 David Cole <david.c...@kitware.com>: > INSTALL rule DESTINATION arguments are intended to be non-full path > directory names, that get placed underneath CMAKE_INSTALL_PREFIX. > > When CPack runs, it tries to build the install target after setting a > value into CMAKE_INSTALL_PREFIX. > > Since your install rules ignore this, by giving full path DESTINATION > values, the install tree that CPack builds does not get all the right > stuff copied into it.
I think we should generate a warning for ABSOLUTE installed files and CPack, many people fall into this caveat. What do you think? > Try using just "bin" and "lib" as the DESTINATION values, and then > adjusting CMAKE_INSTALL_PREFIX to put the root of the install tree > where you want it. Just a precision: CPack is not using the project's CMAKE_INSTALL_PREFIX (unless you set CPACK_SET_DESTDIR to ON) but CPACK_PACKAGING_INSTALL_PREFIX in summary: CMAKE_INSTALL_PREFIX is used for "make install" CPACK_PACKAGING_INSTALL_PREFIX is used for "cpack -G <generator>" Moreover, each CPack generator has a default value for "CPACK_PACKAGING_INSTALL_PREFIX" which is used whenever the user did not specified it; One more thing, you'd better move your "include(CPack)" near the end of your main CMakeLists.txt and in any case after the "add_subdirectory". Putting it before some target definition will lead to unexpected behavior. include(CPack) is more or less equivalent to a function call for which parameters were defined "globally" before the call. For the very same reason any CPACK_xxx var definition should be done **BEFORE** including CPack. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- 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