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

Can't use cmake generator expressions with QT_ANDROID_EXTRA_LIBS on macOS

    XMLWordPrintable

Details

    • Android, macOS
    • c4debab92 (dev)

    Description

      In Qt6AndroidMacros.cmake

      _qt_internal_android_format_deployment_path_property
      

      calls

      file(TO_CMAKE_PATH "${_path}" _path) 
      

      to convert Windows paths to something that can be stored in a json file. This code causes issues on Unix systems when you pass generator expressions to QT_ANDROID_EXTRA_LIBS like $<TARGET_FILE:mylib::mylib> because cmake splits the path passed to TO_CMAKE_PATH base on the native PATH separator ";" [on windows] and ":" [on unix]. So on Unix systems it splits up the generator expressions. I would just wrap

      file(TO_CMAKE_PATH "${_path}" _path)
      

      with something like

      if (CMAKE_HOST_WIN32)
          file(TO_CMAKE_PATH "${_path}" _path)
      endif()
      

      I would almost say this is a cmake bug but it's kinda not at the same time.

      Attachments

        For Gerrit Dashboard: QTBUG-107988
        # Subject Branch Project Status CR V

        Activity

          People

            semlanik Alexey Edelev
            siegelaaron94 Aaron Siegel
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes