Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.6.3, 5.9.3, 5.10.1, 5.11.0 Alpha
-
None
-
macOS 10.12
Description
When building a Qt application with CMake, no -mmacosx-version-min flag is passed to compiled objects.
In qmake's case it uses the value of QMAKE_MACOSX_DEPLOYMENT_TARGET defined in mkspecs/macx-clang/qmake.conf, and passes that value along to -mmacosx-version-min when compiling an object file.
I think the cmake integration should at least expose the value of QMAKE_MACOSX_DEPLOYMENT_TARGET as a variable or target property, and at best actually simulates qmake's logic.
Small sample CMakeLists.txt file.
cmake_minimum_required(VERSION 3.1) project(foo) find_package(Qt5 5.6 REQUIRED COMPONENTS Core) add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core)
main.cpp
#include <QCoreApplication> int main(int argc, char*argv[]) { QCoreApplication app(argc, argv); return 0; }
qmake project
TEMPLATE = app TARGET = bla SOURCES = main.cpp QT += core
Compiling with cmake:
[ 50%] Building CXX object CMakeFiles/bla.dir/main.cpp.o /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DQT_CORE_LIB -DQT_NO_DEBUG -isystem /Volumes/T3/Dev/qt/qt59_built/qtbase/include -isystem /Volumes/T3/Dev/qt/qt59_built/qtbase/include/QtCore -isystem /Volumes/T3/Dev/qt/qt59_built/qtbase/../../qt59_source/qtbase/mkspecs/macx-clang -fPIC -std=gnu++11 -o CMakeFiles/bla.dir/main.cpp.o -c /Volumes/T3/Dev/pyside/old_pyside_setup_circa_2017_before_merge/foo/main.cpp
Compiling with qmake:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../../qt/qt59_built/qtbase/include -I../../../qt/qt59_built/qtbase/include/QtGui -I../../../qt/qt59_built/qtbase/include/QtCore -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I../../../qt/qt59_source/qtbase/mkspecs/macx-clang -o main.o main.cpp
Attachments
Issue Links
- relates to
-
QTBUG-76167 CMake: Minimum macOS deployment target is not set
- Closed