[CMake] CPack RPM: why not <name>-<version>-<release>-<arch>.rpm filename?

Winfried Dobbe winfried_mb2 at xmsnet.nl
Wed Dec 30 05:17:18 EST 2009


When I build a RPM with current CVS CMAKE/CPack for project  
<projectname>
the file name of the generated rpm is:
<projectname>-<version>-Linux.rpm

The common filename for an rpm is
<projectname>-<version>-<release>-<architecture>.rpm

Putting "Linux" in the file name doesn't provide much information  
because
I don't know any other OS that uses the RPM package system.

When I look in the CPackRPM.cmake module I see that the following line  
is
commented out:

#SET(CPACK_RPM_FILE_NAME
"${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-$ 
{CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
and replaced by:
SET(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")

When I set the following variable in my CMakeLists.txt:
set(CPACK_OUTPUT_FILE_NAME
"${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.$ 
{CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-$ 
{CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")

the rpm is generated with the filename that I expect in directory
_CPack_Packages/Linux/RPM, but after that I get the error:
CPack Error: Problem copying the package:
/home/wdobbe/checkout/btbuild/_CPack_Packages/Linux/RPM/ 
buildtools-1.0.0-Linux.rpm
to /home/wdobbe/checkout/btbuild/buildtools-1.0.0-Linux.rpm
CPack Error: Error when generating package: buildtools
make: *** [package] Error 1

So even though I set the rpm output file name, CPack still looks for the
"default" file name.

Can somebody (Eric?) clarify this behaviour?

thanks in advance,
Winfried





More information about the CMake mailing list