我目前正試圖從我的項目中生成多個debian軟件包。我唯一的問題是設置包的名稱,描述,組等等。CMake和CPack的多個debian軟件包的名稱和描述
# --------------------------------------------------------------
# Required CMake version
# --------------------------------------------------------------
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
# --------------------------------------------------------------
# Project name
# --------------------------------------------------------------
PROJECT (MyProject)
# --------------------------------------------------------------
# Find all source and header files
# --------------------------------------------------------------
FILE (GLOB all_H "*.h")
FILE (GLOB all_SRC "*.cpp")
# --------------------------------------------------------------
# Set compiler flags
# --------------------------------------------------------------
SET (CMAKE_CXX_FLAGS "-Wall -Wextra -O0 -g3")
# --------------------------------------------------------------
# Add a shared library
# --------------------------------------------------------------
ADD_LIBRARY (mylib SHARED ${all_H} ${all_SRC})
# --------------------------------------------------------------
# Configure components
# --------------------------------------------------------------
SET (CPACK_DEB_COMPONENT_INSTALL 1)
# --------------------------------------------------------------
# Install
# --------------------------------------------------------------
INSTALL(TARGETS mylib DESTINATION ../lib COMPONENT main)
INSTALL(FILES ${all_H} DESTINATION ../include COMPONENT dev)
# --------------------------------------------------------------
# CPack package and package_source targets
# --------------------------------------------------------------
SET (CPACK_GENERATOR "TGZ;DEB")
SET (CPACK_SET_DESTDIR ON)
SET (CPACK_PACKAGE_NAME "mypackage")
SET (CPACK_PACKAGE_VENDOR "me")
SET (CPACK_PACKAGE_DESCRIPTION_SUMMARY "this is my package description")
SET (CPACK_DEBIAN_PACKAGE_DESCRIPTION "this is my package description
here comes detailed description text.")
INCLUDE (CPack)
的manual有CPack組件的一些屬性和命令,但我似乎沒有找到合適的人或改變至少名稱和描述每一個封裝/組件的正確的地方。我試過使用SET (CPACK_COMPONENT_MAIN_DISPLAY_NAME "main display name")
和SET (CPACK_COMPONENT_main_DISPLAY_NAME "main display name")
以及cpack_add_component()在INCLUDE(CPack)(它給了我一個錯誤)和after(似乎被忽略)之前。
有沒有人得到這個工作,並知道正確的方式來做到這一點?
嗨,請您分享一下您在這個話題上的經驗嗎?你成功地構建了多個deb包嗎? –