Skip to content

Conversation

@traversaro
Copy link

Without this change, configuration in CMake 4.0 fails with:

CMake Error at build/_deps/serial-src/CMakeLists.txt:1 (cmake_minimum_required):
-- Configuring incomplete, errors occurred!
  Compatibility with CMake < 3.5 has been removed from 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.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

@peter-toft-greve
Copy link

Great

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 2.8.3...3.5)
Copy link

@peter-toft-greve peter-toft-greve Apr 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this enough for cmake 4? Don't we need 3.6 or higher?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, CMake 4.0.0 is still compatible with the policy of CMake 3.5 (if you check the error message, it refers to "Compatibility with CMake < 3.5", not "Compatibility with CMake <= 3.5"). This will print a warning for any CMake version >= 3.31, but I wanted to make the least possible invasive change here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good - who can approve?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think the project is maintained, see #275 and #312 .

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi I started a friendly fork with (among other things) CMake 4.0 support at https://github.com/ami-iit/serial_cpp, feel free to check it out.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake_minimum_required(VERSION 3.10) fix compatibility and deprecation warning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants