daid / daid/EmptyEpsilon

[Build] CPack ignores version number in Linux packages if defined via PROJECT_VERSION include instead of CPack params

Open
#2,689 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
869
Forks
222
Avg merge
18h 33m
Merged PRs (30d)
1

Description

Building EmptyEpsilon on Debian 13 with a project include to define PROJECT_VERSION results in the game compiling with the correct version number:

$ cat ../version.cmake
set(PROJECT_VERSION 2024.12.08)
set(PROJECT_VERSION_MAJOR 2024)
set(PROJECT_VERSION_MINOR 12)
set(PROJECT_VERSION_PATCH 8)

$ cmake .. -G Ninja -DSERIOUS_PROTON_DIR=../../SeriousProton -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PROJECT_EmptyEpsilon_INCLUDE=./version.cmake

...

-- EmptyEpsilon Version = 2024.12.08

The correct EE version number can be confirmed by installing the resulting package and running EmptyEpsilon.

However, the DEB package unexpectedly is versioned with today's date instead of the defined major/minor/patch numbers:

$ dpkg --info EmptyEpsilon.deb | grep Version
 Version: 2026.1.6
Image

The same build of the same code using deprecated CPack package version number parameters:

$ cmake .. -G Ninja -DSERIOUS_PROTON_DIR=../../SeriousProton -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCPACK_PACKAGE_VERSION_MAJOR=2024 -DCPACK_PACKAGE_VERSION_MINOR=12 -DCPACK_PACKAGE_VERSION_PATCH=08

creates a DEB package with the defined version number as expected:

$ dpkg --info EmptyEpsilon.deb  | grep Version
 Version: 2024.12.08
Project include build: From EmptyEpsilon/_build:
$ cd ..; rm -rf _build; mkdir -p _build; cd _build
$ cat ../version.cmake 
set(PROJECT_VERSION 2024.12.08)
set(PROJECT_VERSION_MAJOR 2024)
set(PROJECT_VERSION_MINOR 12)
set(PROJECT_VERSION_PATCH 8)
$ cmake .. -G Ninja -DSERIOUS_PROTON_DIR=../../SeriousProton -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PROJECT_EmptyEpsilon_INCLUDE=./version.cmake
CMake Deprecation Warning at CMakeLists.txt:12 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


-- The CXX compiler identification is GNU 14.2.0
-- The C compiler identification is GNU 14.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- EmptyEpsilon Version = 2024.12.08
-- GLM version used: BUNDLED

...

-- Configuring done (30.3s)
-- Generating done (0.1s)
-- Build files have been written to: /home/gguillotte/git/EmptyEpsilon/_build
$ ninja package

...

[485/487] Run CPack packaging tool...
CPack: Create package using DEB
CPack: Install projects
CPack: - Install project: EmptyEpsilon []
CPack: - Install project: SeriousProton []
CPack: Create package
CPack: - package: /home/gguillotte/git/EmptyEpsilon/_build/EmptyEpsilon.deb generated.
CPack: - checksum file: /home/gguillotte/git/EmptyEpsilon/_build/EmptyEpsilon.deb.sha256 generated.
$ dpkg --info EmptyEpsilon.deb 
 new Debian package, version 2.0.
 size 267961322 bytes: control archive=21570 bytes.
     236 bytes,    10 lines      control
   76438 bytes,   744 lines      md5sums
 Architecture: arm64
 Depends: libfreetype6, libsdl2-2.0-0
 Description: EmptyEpsilon built using CMake
 Maintainer: https://github.com/daid/
 Package: emptyepsilon
 Priority: optional
 Section: devel
 Version: 2026.1.6
 Installed-Size: 317607
CPack package version build:
$ cmake .. -G Ninja -DSERIOUS_PROTON_DIR=../../SeriousProton -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCPACK_PACKAGE_VERSION_MAJOR=2024 -DCPACK_PACKAGE_VERSION_MINOR=12 -DCPACK_PACKAGE_VERSION_PATCH=08
CMake Deprecation Warning at CMakeLists.txt:12 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


CMake Deprecation Warning at CMakeLists.txt:19 (message):
  Prefer setting the version through CMAKE_PROJECT_EmptyEpsilon_INCLUDE file
  override


-- The CXX compiler identification is GNU 14.2.0
-- The C compiler identification is GNU 14.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- EmptyEpsilon Version = 2024.12.8
-- GLM version used: BUNDLED

...

-- Found PythonInterp: /usr/bin/python3 (found version "3.13.5")
-- Configuring done (72.2s)
-- Generating done (0.1s)
-- Build files have been written to: /home/gguillotte/git/EmptyEpsilon/_build
$ ninja package
...
[485/486] Run CPack packaging tool...
CPack: Create package using DEB
CPack: Install projects
CPack: - Install project: EmptyEpsilon []
CPack: - Install project: SeriousProton []
CPack: Create package
CPack: - package: /home/gguillotte/git/EmptyEpsilon/_build/EmptyEpsilon.deb generated.
CPack: - checksum file: /home/gguillotte/git/EmptyEpsilon/_build/EmptyEpsilon.deb.sha256 generated.
$ dpkg --info EmptyEpsilon.deb 
 new Debian package, version 2.0.
 size 267961250 bytes: control archive=21570 bytes.
     238 bytes,    10 lines      control
   76438 bytes,   744 lines      md5sums
 Architecture: arm64
 Depends: libfreetype6, libsdl2-2.0-0
 Description: EmptyEpsilon built using CMake
 Maintainer: https://github.com/daid/
 Package: emptyepsilon
 Priority: optional
 Section: devel
 Version: 2024.12.08
 Installed-Size: 317607

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CMakeLists.txt, especially the project version setup around lines 12 and 19, and compare the CMAKE_PROJECT_EmptyEpsilon_INCLUDE path using version.cmake with the deprecated CPack version parameters. Run the documented Ninja package builds and inspect the generated DEB with dpkg --info. Done means the project include version is reflected in the package metadata without deprecated parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.