CPackDeb: Debian package version must not contain hyphens when CPACK_DEBIAN_PACKAGE_RELEASE is not provided!
I am on Ubuntu 16.04 latest CMake. With the recent change of CPack, setting CPACK_PACKAGE_VERSION
alone becomes insufficient and it shows the compilation error
CPackDeb: Debian package version must not contain hyphens when
CPACK_DEBIAN_PACKAGE_RELEASE is not provided!
I simply set the CPACK_PACKAGE_VERSION
to {Latest Release}-{Number of commit after latest release}-{Current commit hash}. Using tinyxml2 as an example, it will be 5.0.1-71-g884852e. However, when I look at https://cmake.org/cmake/help/v3.10/module/CPackDeb.html it is unclear what CPACK_DEBIAN_PACKAGE_RELEASE
is supposed to be set to. I tried setting CPACK_DEBIAN_PACKAGE_RELEASE
also to {Latest Release}-{Number of commit after latest release}-{Current commit hash} but it gives me a new error
CPackDeb: Debian package release must confirm to "^[A-Za-z0-9.+~]+$" regex!
and I have no idea what this means. Can someone tell me what I am suppose to put for CPACK_DEBIAN_PACKAGE_RELEASE
to make it work again?
Below is the complete step by step to reproduce the problem in latest CMake but work with CMake 3.9.2.
git clone https://github.com/leethomason/tinyxml2
cd tinyxml2
echo '\n' >> CMakeLists.txt
echo 'set(CPACK_GENERATOR "DEB")' >> CMakeLists.txt
echo 'set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Jason Juang")' >> CMakeLists.txt
echo 'execute_process(COMMAND bash "-c" "git describe --tags | sed s/[vV]//g" OUTPUT_VARIABLE GIT_TAG)' >> CMakeLists.txt
echo 'string(REGEX REPLACE "\\n$" "" GIT_TAG ${GIT_TAG})' >> CMakeLists.txt
echo 'set (CPACK_PACKAGE_VERSION ${GIT_TAG})' >> CMakeLists.txt
echo 'set (CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)' >> CMakeLists.txt
echo 'set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)' >> CMakeLists.txt
echo 'set (CPACK_PACKAGE_NAME tinyxml2)' >> CMakeLists.txt
echo 'set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "tinyxml2 built using CMake")' >> CMakeLists.txt
echo 'set (CPACK_DEBIAN_PACKAGE_DEBUG ON)' >> CMakeLists.txt
echo 'include(CPack)' >> CMakeLists.txt
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON ..
make package