[CMake] Fwd: CPack does not generate a RPM

Kristian kristianonline28 at gmail.com
Wed Apr 6 20:26:44 EDT 2016


Ok, one part of the problem, I could solve. I could solve the problem
with running the following commands:

cmake . && make package

After that, I get a rpm package. But now, I have another problem and I
do not know, if I am doing something wrong or if this is a bug.

Let's assume, I have a library, e.g. liblibrary.so.5.6.7 and I have
two symbolic links, so the result of "ls -l" would look like this

liblibrary.so -> liblibrary.so.0
liblibrary.so.0 -> liblibrary.so.5.6.7
liblibrary.so.5.6.7

And let's assume, I have these lines in my CMakeLists.txt:

*******
set(LIBRARIES
        ${LIB}/liblibrary.so
        ${LIB}/liblibrary.so.0
        ${LIB}/liblibrary.so.5.6.7)
#...
install(FILES ${LIBRARIES} DESTINATION lib)
*******

Now, I call the commands "cmake . && make package" and I get a package
"project1.1-Linux.rpm". After that, I try to install that package with
"yum install project1.1-Linux.rpm", I get some strange dependency
resolution errors, which would look like this

--> Finished Dependency Resolution
Error: Package: project1.1-1.x86_64 (/project1.1-Linux)
           Requires: liblibrary.so.0()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest


But when I have only these lines in CMakeLists.txt

******
set(LIBRARIES
        ${LIB}/liblibrary.so.0
        ${LIB}/liblibrary.so.5.6.7)
#...
install(FILES ${LIBRARIES} DESTINATION lib)
******

then installation of my very simple project works and I am not getting
any dependency resolution errors.





---------- Forwarded message ----------
From: Kristian <kristianonline28 at gmail.com>
Date: 2016-04-07 0:50 GMT+02:00
Subject: CPack does not generate a RPM
To: cmake at cmake.org


Hi,

I have an error and I do not know, how to solve this error.

I have an archive, where are some files. I want to generate a rpm
package with the files, which are in that archive. So first, I extract
that archive with a bash script. After that, the script calls "cpack
-G RPM -V ." for this CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)
project(project1)

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/usr/bin/calculator DESTINATION bin)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/usr/lib64/* DESTINATION lib)

set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_VERSION_MAJOR 1)
set(CPACK_PACKAGE_VERSION_MINOR 2)
set(CPACK_PACKAGE_NAME "project1")
set(CPACK_RPM_PACKAGE_NAME "project1")
set(CPACK_RPM_PACKAGE_SUMMARY "Some random calculator")
set(CPACK_RPM_PACKAGE_ARCHITECTURE x86_64)
set(CPACK_PACKAGE_VENDOR "Vendor Coorp.")
set(CPACK_RPM_PACKAGE_MAINTAINER "Vendor Coorp.")

INCLUDE(CPack)

But calling the cpack command, I always getting the error "CPack
project name not specified". Why is that? What I am missing?


More information about the CMake mailing list