[CMake] cpack problems.

Axel Roebel Axel.Roebel at ircam.fr
Wed May 10 13:03:31 EDT 2006


Hello,

I just tried the cpack program. It failed when executing
a post_install_script which is configured to access the installed libraries
and to rename them. Unfortunately this seems to be required if one wants to
install a static and a shared library of the same name.

Here the rename script template I use

 FILE(GLOB INSTALLED_LIBNAME $ENV{DESTDIR}@CMAKE_INSTALL_PREFIX@@INSTALL_LIB_DIR
@/*@BEFORE_RENAME@*)
MESSAGE("INSTALLED_LIBNAME  $ENV{DESTDIR}@CMAKE_INSTALL_PREFIX@@INSTALL_LIB_DIR
@/*@BEFORE_RENAME@*")
MESSAGE("INSTALLED_LIBNAME  ${INSTALLED_LIBNAME}")
STRING(REPLACE "@BEFORE_RENAME@" "@AFTER_RENAME@" INSTALLED_NAME_AFTER_RENAME $
{INSTALLED_LIBNAME})
EXEC_PROGRAM(@CMAKE_COMMAND@ ARGS -E copy "${INSTALLED_LIBNAME}" "${INSTALLED_N
AME_AFTER_RENAME}")
EXEC_PROGRAM(@CMAKE_COMMAND@ ARGS -E remove "${INSTALLED_LIBNAME}")

which gets configured when running cmake. BEFORE_RENAME is the internal 
name of the static library and after rename is the name desired after installation.

The problem is that  CMAKE_INSTALL_PREFIX used with cpack is different from the 
CMAKE_INSTALL_PREFIX for real compilation, however, the configured Rename script
always uses the value that is appropriate for a real installation,
 which is a value that I set with FORCE
 in CMakeFiles.txt. I wonder whether there is any possibility to solve this issue?

Now, in fact I don't want a binary distribution I only want a source distribution such that
this issue would vanish automatically. However, I don't find a flag to tell cpack to 
only produce a  source distribution. Is this possible?

I assume with a source distribution the user will be required to first 
install cmake, wouldn't he?

Kind regards,

-- 
Axel Roebel
IRCAM Analysis/Synthesis Team



More information about the CMake mailing list