Skip to content

added POST_BUILD to add_custom_command in python_loader.cmake to avoid warning#26741

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
shyama7004:minor-update
Jan 10, 2025
Merged

added POST_BUILD to add_custom_command in python_loader.cmake to avoid warning#26741
asmorkalov merged 1 commit intoopencv:4.xfrom
shyama7004:minor-update

Conversation

@shyama7004
Copy link
Copy Markdown
Contributor

Description

This pull request resolves a build warning related to add_custom_command in python_loader.cmake by explicitly specifying POST_BUILD.

System Information

  • Operating System: macOS
  • CMake Version: 3.31.3

Resolved Warning

CMake Warning (dev) at modules/python/python_loader.cmake:140 (add_custom_command):
Exactly one of PRE_BUILD, PRE_LINK, or POST_BUILD must be given.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov asmorkalov self-requested a review January 10, 2025 08:53
@asmorkalov asmorkalov added this to the 4.12.0 milestone Jan 10, 2025
@asmorkalov asmorkalov self-assigned this Jan 10, 2025
@VadimLevin VadimLevin self-requested a review January 10, 2025 09:58
Copy link
Copy Markdown
Contributor

@VadimLevin VadimLevin left a comment

Choose a reason for hiding this comment

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

Warning is issued due to changed behavoir controlled by policy CMP0175

The TARGET form requires exactly one of PRE_BUILD, PRE_LINK, or POST_BUILD to be given. Previously, if none were given, POST_BUILD was assumed, or if multiple keywords were given, the last one was used.

@asmorkalov asmorkalov assigned VadimLevin and unassigned asmorkalov Jan 10, 2025
@asmorkalov asmorkalov merged commit 68187de into opencv:4.x Jan 10, 2025
@shyama7004
Copy link
Copy Markdown
Contributor Author

Another warning I noticed is:

  • CMake Version: 3.31.3
  • on macOS
CMake Deprecation Warning at CMakeLists.txt:25 (cmake_minimum_required): 
Compatibility with CMake < 3.10 will be removed from a future version of 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. CMake (cmake_minimum_required)

Version number of a shared library target.

For shared libraries ``VERSION`` and ``SOVERSION`` can be used 
to specify the build version and ABI version respectively. When building or 
installing, appropriate symlinks are created if the platform supports it.

This can be resolved with a simple fix. However, I’d like to know if this should be ignored for now since it’s not causing any errors currently.

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