CPack - 错误 "Numeric user ID too large"

CPack - error "Numeric user ID too large"

我还是 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)

这是一个现已修复的 bug in CMake 3.10 and 3.11。它已在 3.12 中修复。使用 CMake 3.9 或更早版本,或 CMake 3.12 或更高版本。