Skip to content

Conversation

@igormunkin
Copy link
Member

@igormunkin igormunkin commented May 1, 2025

According to the docs1, compatibility with versions of CMake older than 3.5 is deprecated since the version 3.27. Ubuntu 24.04 provides CMake 3.28.3 by default, so uJIT configuration starts spoiling the diagnostics with the following warning:

CMake Deprecation Warning at CMakeLists.txt:11 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

Since there is no particular policies specified in the project CMake machinery, there is no need to stick to the 3.3.2 version. However, migration to the newest version requires more precise changes, so this patch only bumps the minimal required version up to 3.5.

As a result, all explicit includes for CMakeParseArguments module have been removed, because cmake_parse_arguments command is implemented natively since CMake 3.5, and list(FIND ...) hack in the root CMakeLists.txt has been replaced with IN_LIST operator.


Besides there are to more tiny changes, related to cmake_mininum_required.

First of all, the FATAL_ERROR option is accepted but ignored by CMake 2.6 and higher. It should be specified so CMake versions 2.4 and lower fail with an error instead of just a warning. Since compatibility with versions of CMake older than 2.8.12 is already deprecated, there is no need to provide this option anymore.

Furthermore, cmake_minimum_required should be called at the beginning of the top-level CMakeLists.txt (even before calling the project command) to set the version and the policy settings before invoking other commands whose behavior they may affect. All other calls (especially, setting the same version) are definitely excess. Hence, the patch drops cmake_minimum_required calls from all CMakeLists.txt except the root one.


Signed-off-by: Igor Munkin imun@cpan.org

According to the docs[1], <cmake_minimum_required> should be called at
the beginning of the top-level CMakeLists.txt (even before calling the
<project> command) to set the version and the policy settings before
invoking other commands whose behavior they may affect. All other calls
(especially, setting the same version) are definitely excess. Hence, the
patch drops <cmake_minimum_required> calls from all CMakeLists.txt
except the root one.

[1]: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html

Signed-off-by: Igor Munkin <imun@cpan.org>
According to the docs[1], the FATAL_ERROR option is accepted but ignored
by CMake 2.6 and higher. It should be specified so CMake versions 2.4
and lower fail with an error instead of just a warning.

Since compatibility with versions of CMake older than 2.8.12 is already
deprecated, there is no need to provide this option anymore.

[1]: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html

Signed-off-by: Igor Munkin <imun@cpan.org>
According to the docs[1], compatibility with versions of CMake older
than 3.5 is deprecated since the version 3.27. Ubuntu 24.04 provides
CMake 3.28.3 by default, so uJIT configuration starts spoiling the
diagnostics with the following warning:
| CMake Deprecation Warning at CMakeLists.txt:11 (cmake_minimum_required):
|   Compatibility with CMake < 3.5 will be removed from a future version of
|   CMake.
|
|   Update the VERSION argument <min> value or use a ...<max> suffix to tell
|   CMake that the project does not need compatibility with older versions.

Since there is no particular policies specified in the project CMake
machinery, there is no need to stick to the 3.3.2 version. However,
migration to the newest version requires more precise changes, so this
patch only bumps the minimal required version up to 3.5.

[1]: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html

Signed-off-by: Igor Munkin <imun@cpan.org>
CMakeParseArguments module provided <cmake_parse_arguments> command,
that is implemented natively since CMake 3.5. As a result, both
includes, that are empty placeholders now, can be removed.

Signed-off-by: Igor Munkin <imun@cpan.org>
According to the docs[1], IN_LIST operator was introduced in CMake 3.3,
but was not used in uJIT CMake machinery previously for some reasons.
Anyway, CMake 3.5 is the minimal required version now, so this patch
replaces list(FIND ...) hack with IN_LIST operator.

It's worth to mention, that there has always been a policy[2] to tweak
IN_LIST behaviour, but actually, it produces no warning if it's not set
to NEW, so setting this policy is omitted in this patch.

[1]: https://cmake.org/cmake/help/latest/command/if.html#in-list
[2]: https://cmake.org/cmake/help/v3.3/policy/CMP0057.html

Signed-off-by: Igor Munkin <imun@cpan.org>
@igormunkin igormunkin marked this pull request as ready for review May 3, 2025 18:48
@igormunkin igormunkin requested a review from igelhaus May 3, 2025 18:48
@igelhaus igelhaus merged commit 0f91ea5 into master May 4, 2025
16 checks passed
@igormunkin igormunkin deleted the imun/update-cmake branch May 4, 2025 19:41
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