[CMake] CPACK not generating binary install
eric.noulard at gmail.com
Tue Nov 1 15:22:26 EDT 2011
2011/11/1 David Cole <david.cole at 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)
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
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.
Membre de l'April - « promouvoir et défendre le logiciel libre » -
More information about the CMake