From ae37ba6585e95981aadd05a6458c06c4a227a808 Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: Mon, 23 Feb 2026 11:35:57 -0600 Subject: [PATCH 1/3] More modern cmake source tree detection --- CMakeLists.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26cb090..4e959b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,13 +10,14 @@ enable_testing() # ############################################################################## # Require out-of-source builds -file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH) -if(EXISTS "${LOC_PATH}") - message( - FATAL_ERROR - "You cannot build in a source directory (or any directory with a CMakeLists.txt file). Please make a build subdirectory and run cmake from there." - ) -endif(EXISTS "${LOC_PATH}") +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + message(FATAL_ERROR + "In-source builds are not allowed.\n" + "Create a separate build directory and run cmake from there:\n" + " mkdir build && cd build && cmake ..\n" + "Remove CMakeCache.txt and CMakeFiles/ if they were created here." + ) +endif() # ############################################################################## # Compiler Sanity Test From 65a0a0d5c4873b25e3bba4c2ad2e159c9230d3ce Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: Mon, 23 Feb 2026 11:39:06 -0600 Subject: [PATCH 2/3] Add missing check --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e959b9..60de236 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ project(static-subid C) # ############################################################################## # CMake modules include(GNUInstallDirs) +include(CheckCSourceCompiles) include(CheckCCompilerFlag) enable_testing() From 2de85c7c94d6f44c96c734da478a3f2a0033c32c Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: Mon, 23 Feb 2026 11:44:40 -0600 Subject: [PATCH 3/3] Fix typo --- static-subid.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static-subid.spec b/static-subid.spec index 407e8c3..126afd2 100644 --- a/static-subid.spec +++ b/static-subid.spec @@ -19,7 +19,7 @@ Suggests: %{name}-systemd Requires: shadow-utils Summary: Assign deterministic subordinate UID/GID ranges %description -static-subuid is a small utility to generate predictable subordinate UID and GID ranges for Linux users, avoiding the default dynamic allocation behavior used by many systems. +static-subid is a small utility to generate predictable subordinate UID and GID ranges for Linux users, avoiding the default dynamic allocation behavior used by many systems. This can be useful when you need consistent UID/GID mappings across multiple systems (for example in identity-mapped rootless containers or reproducible user namespace setups).