Merge topic 'backport-4.0-cross-compile-macos' into release-4.1

61d0bdf6b7 macOS: Avoid relying on sw_vers when cross-compiling from another OS
d9d65ab54f macOS: Remove outdated condition for CMAKE_OSX_DEPLOYMENT_TARGET

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11340