Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-77376 CMake Port: Upstream CMake issues
  3. QTBUG-77379

Provide an add_application function which would call add_executable or add_library depending on plafform

    XMLWordPrintable

    Details

    • Type: Technical task
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Build System
    • Platform/s:
      All

      Description

      Qt application developers that use CMake and want to write an application targeting both iOS and Android end up having to write:

      if(ANDROID)
        add_library(MyApp)
      elseif(APPLE)
        add_executable(MyApp)
      endif()
      

      This is because on Android, the native C++ part of the application ends up being compiled into a shared library, which is then dynamically loaded (dlopened) by the appropriate .jar / Java runtime.

      Instead of forcing users to write these if() conditions, it would be nice if CMake provided a function called add_application which hides the conditional logic inside the function body.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              alexandru.croitor Alexandru Croitor
              Reporter:
              alexandru.croitor Alexandru Croitor
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes