Control: tags -1 + patch

On Mon, 01 Sep 2025 at 00:57:40 +0200, [email protected] wrote:
During a test rebuild for CMake 4, libccd failed to rebuild.
...
The most likely cause of build failures is the removed backwards compatibility 
for
CMake versions earlier than 3.5.

You can find additional information in my
debian-devel announcement:

https://lists.debian.org/debian-devel/2025/04/msg00310.html

The attached patch addresses this for libccd.

Building with CMake 4 does result in some minor changes to the .cmake files installed by this library: it appears that the new CMake is treating glibc's libm as part of the API, where previously it was treated as an internal implementation detail. Before uploading, please check whether this is acceptable. (It seems reasonable to me, but I am not a CMake expert.)

diffoscope output, comparing a reference build in today's unstable with a version that has the proposed patch and was built with experimental's cmake as an additional build-dependency:

│ │ │ ├── ./usr/lib/x86_64-linux-gnu/ccd/ccd-targets-none.cmake
│ │ │ │ @@ -4,15 +4,14 @@
│ │ │ │
│ │ │ │  # Commands may need to know the format version.
│ │ │ │  set(CMAKE_IMPORT_FILE_VERSION 1)
│ │ │ │
│ │ │ │  # Import target "ccd" for configuration "None"
│ │ │ │  set_property(TARGET ccd APPEND PROPERTY IMPORTED_CONFIGURATIONS NONE)
│ │ │ │  set_target_properties(ccd PROPERTIES
│ │ │ │ -  IMPORTED_LINK_INTERFACE_LIBRARIES_NONE 
"/usr/lib/x86_64-linux-gnu/libm.so"
│ │ │ │    IMPORTED_LOCATION_NONE 
"${_IMPORT_PREFIX}/lib/x86_64-linux-gnu/libccd.so.2.0"
│ │ │ │    IMPORTED_SONAME_NONE "libccd.so.2"
│ │ │ │    )
│ │ │ │
│ │ │ │  list(APPEND _cmake_import_check_targets ccd )
│ │ │ │  list(APPEND _cmake_import_check_files_for_ccd 
"${_IMPORT_PREFIX}/lib/x86_64-linux-gnu/libccd.so.2.0" )
│ │ │ ├── ./usr/lib/x86_64-linux-gnu/ccd/ccd-targets.cmake
│ │ │ │ @@ -1,17 +1,17 @@
│ │ │ │  # Generated by CMake
│ │ │ │
│ │ │ │  if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
│ │ │ │ -   message(FATAL_ERROR "CMake >= 2.8.3 required")
│ │ │ │ +   message(FATAL_ERROR "CMake >= 2.8.12 required")
│ │ │ │  endif()
│ │ │ │ -if(CMAKE_VERSION VERSION_LESS "2.8.3")
│ │ │ │ -   message(FATAL_ERROR "CMake >= 2.8.3 required")
│ │ │ │ +if(CMAKE_VERSION VERSION_LESS "2.8.12")
│ │ │ │ +   message(FATAL_ERROR "CMake >= 2.8.12 required")
│ │ │ │  endif()
│ │ │ │  cmake_policy(PUSH)
│ │ │ │ -cmake_policy(VERSION 2.8.3...3.29)
│ │ │ │ +cmake_policy(VERSION 2.8.12...3.31)
│ │ │ │  #----------------------------------------------------------------
│ │ │ │  # Generated CMake target import file.
│ │ │ │  #----------------------------------------------------------------
│ │ │ │
│ │ │ │  # Commands may need to know the format version.
│ │ │ │  set(CMAKE_IMPORT_FILE_VERSION 1)
│ │ │ │
│ │ │ │ @@ -65,14 +65,15 @@
│ │ │ │  endif()
│ │ │ │
│ │ │ │  # Create imported target ccd
│ │ │ │  add_library(ccd SHARED IMPORTED)
│ │ │ │
│ │ │ │  set_target_properties(ccd PROPERTIES
│ │ │ │    INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
│ │ │ │ +  INTERFACE_LINK_LIBRARIES "/usr/lib/x86_64-linux-gnu/libm.so"
│ │ │ │  )
│ │ │ │
│ │ │ │  # Load information for each installed configuration.
│ │ │ │  file(GLOB _cmake_config_files 
"${CMAKE_CURRENT_LIST_DIR}/ccd-targets-*.cmake")
│ │ │ │  foreach(_cmake_config_file IN LISTS _cmake_config_files)
│ │ │ │    include("${_cmake_config_file}")
│ │ │ │  endforeach()

I hope this is helpful,
    smcv
>From 3ccb14fff7886a7c854d8ff949b39919cb60a61c Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Fri, 26 Sep 2025 16:16:55 +0100
Subject: [PATCH] d/rules: Declare compatibility with modern CMake versions

Closes: #1113125
---
 debian/rules | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/rules b/debian/rules
index 1cb02ee..a79d634 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
 
 override_dh_auto_configure:
 	dh_auto_configure --  \
+	    -DCMAKE_POLICY_VERSION_MINIMUM=3.31 \
 	    -DCCD_DOUBLE:BOOL=True
 
 # Avoid to run the legacy autotools files and use cmake
-- 
2.51.0

Reply via email to