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

Figure out how to set new CMake policies in all Qt repos without duplicating them in each repo

    XMLWordPrintable

Details

    Description

      Currently to build Qt we require CMake 3.18.

      CMake 3.19 is now out which introduces new CMake policies. These policies default to OLD behaviour when building Qt with version 3.19+. Unless we bump the cmake_minimum_required() calls to 3.19+, but that is very unlikely for now.

      Sometime these policies issue scary warnings when building Qt, which we would like to avoid.
      At the moment, we get such warnings for CMP0112 (with --trace-redirect) and CMP0116.

      We need to find a way how to call cmake_policy(CMPXXX NEW) when building all Qt repos.

      Preferably without being forced to copy-paste the lines in each repo separately.

      This proves to be difficult because CMake has a concept of policy scopes.
      These scopes have very strange (and inconvenient for us) semantics, where a new policy scope is created for each include() and find_package() call. Also functions and macros record their policy scopes at creation time, and somehow bubble up the policy values to the callee higher in the scope tree.

      The end result is that it proves to be difficult to propagate new policy scopes via find_package(Qt6 COMPONENTS BuildInternals).

      Investigate what's the best way to solve this.

      Attachments

        Issue Links

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

          Activity

            People

              crscott Craig Scott
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: