CentOS6.9 / cmake 3.6.1
On my project I'm trying to create several components, than build runtime, devel and debuginfo packages for them, but I was unable to produce more than one rpm for each component. I created small project to show the problem:
./include/Box.hpp
namespace room {
class Box {
public:
Box(int volume);
int get_volume() const;
private:
int m_volume;
};
}
./source/Box.cpp
#include "Box.hpp"
namespace room {
Box::Box(int volume)
: m_volume(volume)
{
}
int Box::get_volume() const
{
return this->m_volume;
}
}
./source/app.cpp
#include "Box.hpp"
int main() {
room::Box box(5);
return box.get_volume();
}
./CMakeLists.txt
cmake_minimum_required(VERSION 3.6)
project (home)
set(CMAKE_INSTALL_PREFIX "/usr/local")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
include_directories("include")
file(GLOB SRC_FILES "source/*.cpp")
file(GLOB HDR_FILES "include/*.hpp")
add_executable(${PROJECT_NAME} ${SRC_FILES})
install(FILES ${HDR_FILES} DESTINATION "include" COMPONENT devel)
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION "bin" COMPONENT devel)
set(CPACK_COMPONENTS_ALL devel)
set(CPACK_RPM_PACKAGE_DEBUG 1)
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_GENERATOR "RPM")
set(CPACK_RPM_DEVEL_FILE_NAME "${PROJECT_NAME}-devel.rpm")
set(CPACK_RPM_DEVEL_DEBUGINFO_PACKAGE ON)
set(CPACK_RPM_DEVEL_DEBUGINFO_FILE_NAME "${PROJECT_NAME}-devel-debuginfo.rpm")
include(CPack)
console:
$ mkdir BUILD && cd BUILD && cmake3 .. && make -j5 && make package
But after this actions I see only one 'devel' rpm and no rpm with debuginfo. I looked at documentation and couldn't find any idea where I am wrong. Could someone clarify it to me? Thank you for any suggestions.