CMake configuration fails when using CMake 4.0. (Issue #25253)

219 views
Skip to first unread message

Dave Frischknecht

unread,
Mar 18, 2025, 6:51:08 PMMar 18
to wx-...@googlegroups.com, Subscribed

Build System Used

I build wxWidgets and/or my application using:

  • CMake
  • configure
  • mingw32-make with makefile.gcc
  • MSBuild (Microsoft Visual Studio solution file)
  • nmake with makefile.vc
  • Xcode

Description

When I try to use the CMake GUI to configure the project, it fails with the message shown below:

CMake Error at CMakeLists.txt:10 (cmake_minimum_required):
  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.


Configuring incomplete, errors occurred!

I am able to work around the issue by adding the cache entry suggested in the error message.

Platform and version information

  • wxWidgets version you are building: 3.2.6
  • wxWidgets port you are building: wxMSW
  • OS and its version: Windows 11
  • Compiler being used: MSVS 2022
  • Non-default compiler options, if any :

I launched the CMake GUI from within the "x64 Native Tools Command Prompt" that is installed with Visual Studio.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25253@github.com>

fishnet37222fishnet37222 created an issue (wxWidgets/wxWidgets#25253)

Build System Used

I build wxWidgets and/or my application using:

  • CMake
  • configure
  • mingw32-make with makefile.gcc
  • MSBuild (Microsoft Visual Studio solution file)
  • nmake with makefile.vc
  • Xcode

Description

When I try to use the CMake GUI to configure the project, it fails with the message shown below:

CMake Error at CMakeLists.txt:10 (cmake_minimum_required):
  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.


Configuring incomplete, errors occurred!

I am able to work around the issue by adding the cache entry suggested in the error message.

Platform and version information

  • wxWidgets version you are building: 3.2.6
  • wxWidgets port you are building: wxMSW
  • OS and its version: Windows 11
  • Compiler being used: MSVS 2022
  • Non-default compiler options, if any :

I launched the CMake GUI from within the "x64 Native Tools Command Prompt" that is installed with Visual Studio.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25253@github.com>

Dave Frischknecht

unread,
Mar 18, 2025, 7:17:14 PMMar 18
to wx-...@googlegroups.com, Subscribed

This issue also affects those using vcpkg in an up-to-date version of Visual Studio. In that case, the workaround is not available.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25253/2734935618@github.com>

fishnet37222fishnet37222 left a comment (wxWidgets/wxWidgets#25253)

This issue also affects those using vcpkg in an up-to-date version of Visual Studio. In that case, the workaround is not available.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25253/2734935618@github.com>

VZ

unread,
Mar 18, 2025, 7:28:31 PMMar 18
to wx-...@googlegroups.com, Subscribed

Thanks for reporting this, I had no idea CMake 4.0 would break compatibility like this but, well, can't say that this is really very surprising.

If our makefiles already work with CMake 4.0, would it be just a matter of replace 3.31 with 4.0 in the cmake_minimum_required() line in the top-level CMakeLists.txt? If so, perhaps it would be worth redoing the source archives for 3.2.7 to include this fix...

Of course, if more extensive changes are required, then it's too late for this release (but hopefully not for 3.3.0).


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25253/2734948175@github.com>

vadzvadz left a comment (wxWidgets/wxWidgets#25253)

Thanks for reporting this, I had no idea CMake 4.0 would break compatibility like this but, well, can't say that this is really very surprising.

If our makefiles already work with CMake 4.0, would it be just a matter of replace 3.31 with 4.0 in the cmake_minimum_required() line in the top-level CMakeLists.txt? If so, perhaps it would be worth redoing the source archives for 3.2.7 to include this fix...

Of course, if more extensive changes are required, then it's too late for this release (but hopefully not for 3.3.0).


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25253/2734948175@github.com>

Braden Obrzut

unread,
Mar 20, 2025, 9:08:54 AMMar 20
to wx-...@googlegroups.com, Subscribed

3.2.7 should also be unaffected due to c82cec8. Kitware is not requiring that the minimum version be raised as the second paragraph of the error (previously warning) states, you just have to accept the newer policies which what the upper value of the range specifies.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25253/2740401016@github.com>

Blzut3Blzut3 left a comment (wxWidgets/wxWidgets#25253)

3.2.7 should also be unaffected due to c82cec8. Kitware is not requiring that the minimum version be raised as the second paragraph of the error (previously warning) states, you just have to accept the newer policies which what the upper value of the range specifies.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25253/2740401016@github.com>

VZ

unread,
Mar 20, 2025, 12:26:39 PMMar 20
to wx-...@googlegroups.com, Subscribed

Closed #25253 as completed.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/25253/issue_event/16914198831@github.com>

VZ

unread,
Mar 20, 2025, 12:26:39 PMMar 20
to wx-...@googlegroups.com, Subscribed

Ah, good to know, thanks. If so, this has been already fixed and can be closed.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25253/2741029475@github.com>

vadzvadz left a comment (wxWidgets/wxWidgets#25253)

Ah, good to know, thanks. If so, this has been already fixed and can be closed.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25253/2741029475@github.com>

Reply all
Reply to author
Forward
0 new messages