CMakeLists.txt proposed fixes for building on Gentoo Linux - #129
Open
Anoncheg1 wants to merge 1 commit into
Open
CMakeLists.txt proposed fixes for building on Gentoo Linux #129Anoncheg1 wants to merge 1 commit into
Anoncheg1 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! I created Gentoo ebuild file with instruction to compile package from sources.
https://github.com/Anoncheg1/anonch-overlay/blob/main/dev-games/zenkit/zenkit-20251220.ebuild
it is for 2025-12-20 0e3b3f6
I use system Gentoo package instead of built-in:
I tested it with working OpenGothic
https://github.com/Anoncheg1/anonch-overlay/blob/main/games-engines/opengothic/opengothic-1.0.3549.ebuild
Here is list of issues and fixes for CMakeLists.txt file. They simplify creation of Gentoo Ebuild. Please consider them to include in main.
ZenKit CMake Improvements for System Packaging
Focus On
find_package()calls forglm,squish, anddoctest${doctest_SOURCE_DIR}assumption and provide a staticdoctest_main.ccinclude/phoenixpath and stop installing bundled dependency headersDetailed Description
1. Dependency Management (
glmandsquish)Issue: The current
CMakeLists.txthardcodes vendor-specific target names (glm::glm_static) and lacks properfind_package()fallbacks. This completely breaks system packaging on distributions like Gentoo, where libraries are provided by the system package manager rather than built from bundled sources.Impact: Package maintainers must forcefully overwrite
vendor/CMakeLists.txtand usesedto rewrite target names — a fragile and non-portable solution.Better Approach:
find_package(glm REQUIRED)andfind_package(squish REQUIRED)at the top of the rootCMakeLists.txtglm::glm,squish) instead of hardcoded static variantsif(NOT TARGET glm::glm)then fall back toadd_subdirectory(vendor/...)Note on
squish: Gentoo'smedia-libs/libsquishinstalls its header as/usr/include/squish/squish.h(inside a subdirectory). Upstream should either document this expectation or provide a proper CMake config module forsquishthat setsINTERFACE_INCLUDE_DIRECTORIEScorrectly.2. Test Framework Integration (
doctest)Issue: The current code relies on
${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake, which is only defined whendoctestis built viaFetchContentoradd_subdirectory(). Whendoctestis installed system-wide via a package manager (providing onlydoctest-config.cmake), this variable is undefined, and the include fails.Additionally, the current approach dynamically generates a
doctest_with_mainlibrary viafile(WRITE ...)inside CMake, which is non-idiomatic and complicates packaging.Impact: System-packaged
doctestcannot be used without patching.Better Approach:
find_package(doctest REQUIRED)to obtain thedoctest::doctestimported targetinclude("${doctest_DIR}/doctest.cmake")to get thedoctest_discover_tests()function. (Note:find_package()alone provides the target but not the helper functions — both steps are required.)tests/doctest_main.ccfile containing:3. Installation Rules (Obsolete Paths & Bundled Headers)
Issue:
install(DIRECTORY "include/phoenix" TYPE INCLUDE)references a directory that was renamed tozenkit, causing CMake to error or warn during the install phase.CMakeLists.txtcontains a loop that attempts to installglmheaders. Package managers strictly control system headers, and bundled dependencies should not be re-installed.Impact: Package builds fail or produce warnings; system headers may be duplicated or conflict with the system-provided
glmpackage.Better Approach:
install(DIRECTORY "include/phoenix" ...)line entirely.glminstallation loop. Consumers of ZenKit willfind_package(glm)themselves if needed.ZK_INSTALL_BUNDLED_DEPS, defaulting toOFF).