我对CMake/CPack工具还不熟悉。这是我对CPack问题的一个简短的例子--真正的项目要大得多。我的CMakeLists.txt文件如下:
cmake_minimum_required(VERSION 3.9)
project(tm0001)
set(CMAKE_CXX_STANDARD 11)
add_executable(${PROJECT_NAME} tm0001.cpp)
set(CPACK_PACKAGE_CONTACT "HEKTO")
set(CPACK_PACKAGE_VERSION_MAJOR 1)
set(CPACK_PACKAGE_VERSION_MINOR 0)
set(CPACK_PACKAGE_VERSION_PATCH 0)
set(CPACK_GENERATOR "DEB")
include(CPack)tm0001.cpp文件中的内容并不重要--它可能只是一个简单的Hello World程序。我试图为这个项目生成一个deb文件,但是得到了一个错误:
hekto@ubuntu:~/tm0001/build$ make package
Scanning dependencies of target tm0001
[ 50%] Building CXX object CMakeFiles/tm0001.dir/tm0001.cpp.o
[100%] Linking CXX executable tm0001
[100%] Built target tm0001
Run CPack packaging tool...
CPack: Create package using DEB
CPack: Install projects
CPack: - Run preinstall target for: tm0001
CPack: - Install project: tm0001
CPack: Create package
CPack Error: Error creating debian package:
#top level directory: /home/hekto/tm0001/build/_CPack_Packages/Linux/DEB
#file: tm0001-1.0.0-Linux.deb
#error:archive_write_header: Numeric user ID too large
CPack Error: Problem compressing the directory
CPack Error: Error when generating package: tm0001
make: *** [package] Error 1这条Numeric user ID too large消息的意义是什么?从哪来的?怎么摆脱它?
(CMake/CPack版本为3.11.3)
发布于 2018-09-10 22:27:42
这是一个现在修正的CMake 3.10和3.11中的错误.它已在3.12中得到修正。要么使用CMake 3.9或更早版本,要么使用CMake 3.12或更高版本。
https://stackoverflow.com/questions/52265399
复制相似问题