Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call project() before before enable_language() in CmakeLists.txt … #2125

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

Quba1
Copy link

@Quba1 Quba1 commented Oct 30, 2024

This change fixes the warning appearing when calling configure_new with newer versions of Cmake.

TYPE: bug fix

KEYWORDS: cmake, configure

SOURCE: Jakub Lewandowski (University of Leeds)

DESCRIPTION OF CHANGES:
Problem:
When calling configure_new script with newer versions of Cmake (3.30.5 in my case) warning appears:

CMake Warning (dev) at CMakeLists.txt:5 (enable_language):
  project() should be called prior to this enable_language() call.
This warning is for project developers.  Use -Wno-dev to suppress it.

Solution:
This is easily fixable by calling project() before enable_language() as the warning suggests.

ISSUE: For use when this PR closes an issue.
n/a

LIST OF MODIFIED FILES: CmakeLists.txt

TESTS CONDUCTED:

  1. Do mods fix problem? How can that be demonstrated, and was that test conducted?
  2. Are the Jenkins tests all passing?

I tested the change on my machine and it solved the issue. As the change is very minor it should not cause issues for others.

RELEASE NOTE: Fixed CMake dev warning project() should be called prior to this enable_language() call appearing when using configure_new script with some newer versions of Cmake.

Copy link
Collaborator

@islas islas left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@amstokely amstokely self-requested a review December 20, 2024 23:40
@islas islas merged commit 0ccba14 into wrf-model:develop Dec 20, 2024
4 of 8 checks passed
islas added a commit that referenced this pull request Dec 20, 2024
TYPE: bug fix

KEYWORDS: autogeneration, compilation, cmake

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
Currently the CMake build system minimum version is limited by the
automated scoping of generated property on certain source files. This in
combination of `CMP0118` requires usage of CMake >3.20

Solution:
Set the generated property at the correct scope for source file usage.
Lower the minimum required version to reflect this change. Note that
CMake 3.18.6 is not used as there are features from 3.19 in use that,
while could be implemented by hand, would take more effort to remove
than the gained benefit.

TESTS CONDUCTED: 
1. Combined with #2125, #2130, and #2131 this was tested on the latest
patch of each unique minor release of CMake since v3.19.8. The full list
of tested versions is as follows:
v3.19.8
v3.20.6
v3.21.7
v3.22.6
v3.23.5
v3.24.4
v3.25.3
v3.26.6
v3.27.9
v3.28.6
v3.29.8
v3.30.5
v3.31.0

RELEASE NOTE: 
Set the generated property on autogen source code explicitly in CMake
and allow for lowered minimum CMake version of v3.19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants