Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-88926

Add support for WIN32 and MACOSX_BUNDLE to qt6_add_executable()

    XMLWordPrintable

Details

    • All
    • 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

        Activity

          People

            cadam Cristian Adam
            crscott Craig Scott
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes