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

qmake2cmake: convert qmake INSTALLS targets to cmake install commands

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • Build tools: Other
    • None

    Description

      implement "postinstall" commands

      example input

      target.path = /dst
      target.extra = echo hello world
      
      another_target.path = /dst
      another_target.files = a.txt
      another_target.depends = target
      
      INSTALLS = target another_target
      

      cmake has no equivalent construct, so my implementation works by adding a series of install commands, which cmake will execute in order of appearance. qmake2cmake resolves the install order from the target dependencies

      # install_target
      install(CODE [[
        message(STATUS "Installing: /tmp/a.txt")
        execute_process(
          COMMAND echo hello world
          COMMAND_ERROR_IS_FATAL ANY
        )
      ]])
      
      # install_another_target
      # depends on: install_target
      install(CODE [[
        message(STATUS "Installing: /tmp/a.txt")
        file(COPY /src/a.txt DESTINATION /dst/a.txt)
      ]])
      

      please see my patches in
      https://github.com/milahu/qmake2cmake/tree/fix-for-pyqt-builder
      i have little motivation to mess with qt's gerrit interface, so please feel free to use my code

      status: working prototype

      this works to build pyqt6
      pyqt-builder generates qmake .pro files
      and instead of qmake, i call qmake2cmake_all and cmake

      with pyqt-builder, im hitting a non-trivial bug in qmake_parser.py:
      the original whitespace is lost in scope.get_string(key)
      but there is a simple workaround: use quoted strings in the .pro file
      i will post this in a separate issue

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            milahu milan hauth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes