Skip to content

Update Minimum CMakeLists.txt Version to Modern Specification #84

@carson-loyal-ai

Description

@carson-loyal-ai

Issue: Update CMake Minimum Required Version to 3.5

Problem Description

The libccd project currently specifies a minimum CMake version of 2.8.11. This version is quite old and has become a source of compatibility issues when building the library on modern systems and with newer toolchains. Specifically through Conan and ConanCenter. Users frequently encounter warnings or errors related to outdated CMake features or policies, making it challenging to integrate libccd into projects that rely on more recent CMake versions.

Specifically, CMake 2.8.11 lacks support for many modern CMake idioms and features, which can lead to:

  • Build system warnings or errors with newer compilers (e.g., C++11/14/17 features).
  • Difficulties in integrating libccd as a subproject in larger CMake-based projects that use a higher minimum version.
  • Inability to leverage modern CMake practices for dependency management, linking, and target properties.

Proposed Solution

I want to propose updating the minimum required CMake version in CMakeLists.txt to at LEAST 3.5.

CMake 3.5 was released a while back (2015 I think) and is widely adopted, offering a good balance between modern features and broad compatibility. It introduced several key improvements relevant to libccd's build system, such as:

  • Improved target_link_libraries signature with PRIVATE, PUBLIC, and INTERFACE keywords, leading to more robust and explicit dependency management.
  • Better support for modern C++ standards.
  • Enhanced module handling and property management.

Updating to 3.5 would significantly improve the build experience for users on newer and using Conan on newer systems without requiring an excessively high or bleeding-edge CMake version.

Benefits

  • Enhanced Compatibility: Resolves build issues and warnings encountered with newer compilers and operating systems.
  • Modern CMake Practices: Allows libccd to adopt more robust and maintainable CMake patterns.
  • Easier Integration: Simplifies the process of incorporating libccd into other projects that utilize modern CMake.
  • Future-Proofing: Provides a more stable foundation for future development and maintenance of the build system.

Impact

This change primarily affects the build system configuration and should not impact the core functionality or API of the libccd library itself. It is a non-breaking change for users who already have CMake 3.5 or newer installed.

I believe this update is a necessary step to ensure the continued usability and accessibility of libccd for a wider range of developers and environments.

I have tested this by only changing the cmake_minimum_version to 3.5 and the library builds and runs as expected so I do not think the impact will be require more work than that simple change.

Thanks and great library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions