Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
6.0.0 Beta5
-
-
7b5fd05e8bdfe90af689541b0379289eb54b4079 (qt/qtbase/dev) b5ecdce605685996a5e280edd164f8853f8326df (qt/qtbase/6.0)
Description
The standard CMake add_executable() command accepts the keywords WIN32 and MACOSX_BUNDLE. When building for the relevant platform, these keywords set the corresponding target property, otherwise the keyword is ignored. It would be good if qt6_add_executable() also understood these keywords so that its behavior is more compatible with the add_executable() command. This would allow code to be expressed more simply. Here's the before/after comparison:
Before:
qt_add_executable(basic main.cpp ) set_target_properties(basic PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE )
After:
qt_add_executable(basic WIN32 MACOSX_BUNDLE main.cpp )
For the Android case, the implementation of qt6_add_executable() would have to explicitly check for and silently drop these keywords, since it creates a library rather than an executable for the Android case.
Attachments
For Gerrit Dashboard: QTBUG-88926 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
324275,2 | CMake: Allow WIN32 and MACOSX_BUNDLE arguments for qt6_add_executable | dev | qt/qtbase | Status: MERGED | +2 | 0 |
324737,2 | CMake: Allow WIN32 and MACOSX_BUNDLE arguments for qt6_add_executable | 6.0 | qt/qtbase | Status: MERGED | +2 | 0 |