How to specify target mac os x version using qmake

孤者浪人 提交于 2019-12-03 03:14:20

You can actually add that deployment target line QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 to your QMake project file. You don't have to reinstall Qt.

One thing to keep in mind, though: if you build any other libraries that you include in your application bundle, make sure they're also compiled for backwards compatibility! In case it helps with any libraries, there's an equivalent CMake command as well, CMAKE_OSX_DEPLOYMENT TARGET.

BigONotation

OK found the solution after having looked at a similar question: QtCreator build system is broken after OSX upgrade

You can change the minimal Mac OS X target by updating the qmake.conf file for clang in your Qt installation (I am using Qt5.3). The file is located in the Qt installation directory at Qt/5.3/clang_64/mkspecs/macx-clang/qmake.conf The updated version is given below:

#
# qmake configuration for Clang on OS X
#

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += app_bundle incremental global_init_link_order lib_version_first     plugin_no_soname
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/macx.conf)
include(../common/gcc-base-mac.conf)
include(../common/clang.conf)
include(../common/clang-mac.conf)

#QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7

load(qt_config)

Note that I've commented out the default QMAKE_MACOSX_DEPLOYMENT_TARGET version providing with the Qt install.

Finally, you can also specify which sdk to use in your .pro file as follows:

macx {
    QMAKE_MAC_SDK = macosx10.9
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!