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

Qt6Core_INCLUDE_DIRS cmake variable contains suspicious stuff on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7.0 FF
    • 6.6.0
    • Build System: CMake
    • None
    • Windows
    • a3f1b8e4d (dev)

    Description

      Qt6Core_INCLUDE_DIRS contains actually this on Windows

      C:/Qt/6.6.0/msvc2019_64/include/QtCoreC:/Qt/6.6.0/msvc2019_64/includeC:/Qt/6.6.0/msvc2019_64/include/QtZlib$<$<BOOL:$<TARGET_PROPERTY:Qt6::ZlibPrivate,_qt_module_has_private_headers>>:>$<$<BOOL:$<TARGET_PROPERTY:Qt6::ZlibPrivate,_qt_module_has_private_headers>>:C:/Qt/6.6.0/msvc2019_64/include/QtZlib/6.6.0>$<$<BOOL:$<TARGET_PROPERTY:Qt6::ZlibPrivate,_qt_module_has_private_headers>>:C:/Qt/6.6.0/msvc2019_64/include/QtZlib/6.6.0/QtZlib> 

      while on Linux it only contains

      /usr/include/x86_64-linux-gnu/qt6/QtCore;/usr/include/x86_64-linux-gnu/qt6 

      this makes cross platform development impossible. When I use this in my project:

      set(CMAKE_REQUIRED_INCLUDES ${Qt6Core_INCLUDE_DIRS})
      check_include_file_cxx(QtGui/qtgui-config.h HAVE_QTGUI_CONFIG_H) 

      it works on Linux but fails on Windows with this error

      Looking for C++ include QtGui/qtgui-config.h
      CMake Debug Log at C:/Program Files/CMake/share/cmake-3.28/Modules/CheckIncludeFileCXX.cmake:89 (try_compile):
        Executing try_compile (HAVE_QTGUI_CONFIG_H) in:
      
          C:/prog/cpp/CMake/bld/CMakeFiles/CMakeScratch/TryCompile-ykkc7b
      Call Stack (most recent call first):
        CMakeLists.txt:7 (check_include_file_cxx)
      
      
      CMake Error at C:/prog/cpp/CMake/bld/CMakeFiles/CMakeScratch/TryCompile-ykkc7b/CMakeLists.txt:14 (include_directories):
        Error evaluating generator expression:
      
          $<TARGET_PROPERTY:Qt6::ZlibPrivate,_qt_module_has_private_headers>
      
        Target "Qt6::ZlibPrivate" not found.

      Attachments

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

        Activity

          People

            semlanik Alexey Edelev
            yu_jin Yu Jin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes