Details
-
Bug
-
Resolution: Won't Do
-
P4: Low
-
None
-
4.7.4, 4.8.0
-
None
-
Mac OS X combined with external software that uses MAC_OS_X_VERSION_MIN_REQUIRED to enable/disable/configure features (such as the Insight Toolkit - ITK).
Description
Although qmake has a QMAKE_MACOSX_DEPLOYMENT_TARGET variable, qglobal.h always sets MAC_OS_X_VERSION_MIN_REQUIRED to MAC_OS_X_VERSION_10_4, overriding an 'export MACOSX_DEPLOYMENT_TARGET' and '-mmacosx-version-min=10.5' from the Makefile:
qglobal.h:301
#ifdef Q_OS_DARWIN
- ifdef MAC_OS_X_VERSION_MIN_REQUIRED
- undef MAC_OS_X_VERSION_MIN_REQUIRED
- endif
- define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4
This leads to problems for instance with the widely used Insight Toolkit (ITK), which uses MAC_OS_X_VERSION_MIN_REQUIRED in its itkLightObject to configure reference counting. Above bug leads to ITK using a different type for the reference counter internally than what a program using Qt will use, leading to hard to debug crashes in ITK's smart pointer system.
See this discussion on the ITK mailinglist:
[Insight-users] ITK crash on Lion/Qt
http://www.itk.org/pipermail/insight-users/2011-October/042715.html
qglobal.h does '#include <AvailabilityMacros.h>', which would do the right thing, however, since MAC_OS_X_VERSION_MIN_REQUIRED is already defined it does not override it.
Please also note that the default for MAC_OS_X_VERSION_MIN_REQUIRED would be the currently build-on version (e.g. 1068 for Snow Leopard 10.6.8), so forcing the min version to 10.4 is not expected by Mac developers using a more recent operating system. In particular since Mac OS X did change significantly between 10.4 and 10.5 and thus many modern features are not available to the Qt developer.
My suggestion is for qglobal.h to keep MAC_OS_X_VERSION_MIN_REQUIRED alone and just rely on AvailabilityMacros.h (as anybody else on this platform does).
I would be happy to provide a patch (remove above mentioned lines) if that helps.