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

Fix CMake 3.31 warnings #59703

Merged
merged 1 commit into from
Dec 3, 2024
Merged

Fix CMake 3.31 warnings #59703

merged 1 commit into from
Dec 3, 2024

Conversation

rouault
Copy link
Contributor

@rouault rouault commented Dec 2, 2024

No description provided.

@github-actions github-actions bot added this to the 3.42.0 milestone Dec 2, 2024
@@ -406,7 +406,7 @@ foreach(pyfile ${PY_FILES})
COMMAND ${CMAKE_COMMAND} -E make_directory "${QGIS_PYTHON_OUTPUT_DIRECTORY}"
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} "${QGIS_PYTHON_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${pyfile}
# DEPENDS ${pyfile}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the story here? Does newer cmake auto-determine this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, that has never been valid and is ignored: cf https://cmake.org/cmake/help/latest/command/add_custom_command.html#build-events
We'd need using some other CMake syntax to handle dependencies

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like it was there up till 3.31: https://cmake.org/cmake/help/v3.31/command/add_custom_command.html#depends

You aren't looking at the variant of add_custom_command() we use in the lines I modified. There are 2: the one whose first keyword is OUTPUT and which accepts a DEPENDS, and the one we use here which starts with TARGET and doesn't accept DEPENDS. I've been confused by that many times
If you look way back like 3.16 the TARGET variant has never accepted DEPENDS: https://cmake.org/cmake/help/v3.16/command/add_custom_command.html#build-events . I assume it was silently ignored, and in 3.31 likely due to people complaining their DEPENDS was ignored, they start warning.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, thanks for the explanation! If this was never working then let's just remove those lines instead of commenting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes I had an hesitation if we'd want to keep them as a memory that we may want to do something more involved to track dependencies. But I'm fine removing them too

Copy link

github-actions bot commented Dec 2, 2024

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 119c4c6)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 119c4c6)

@nyalldawson nyalldawson merged commit 5665665 into qgis:master Dec 3, 2024
35 checks passed
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.

2 participants