-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix CMake 3.31 warnings #59703
Conversation
@@ -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} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
No description provided.