Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Why does ${Qt6Core_INCLUDE_DIRS} contain Qt6::ZlibPrivate?
Forum Updated to NodeBB v4.3 + New Features

Why does ${Qt6Core_INCLUDE_DIRS} contain Qt6::ZlibPrivate?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 695 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gertio
    wrote on last edited by Gertio
    #1

    Hello,

    I have an understanding problem with this variable, basically the following CMake minimal example configuration fails:

    cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
    include(CheckIncludeFileCXX)
    
    project(CMake LANGUAGES CXX)
    find_package(Qt6 REQUIRED COMPONENTS Core Widgets Gui)
    set(CMAKE_REQUIRED_INCLUDES ${Qt6Core_INCLUDE_DIRS})
    check_include_file_cxx(QtGui/qtgui-config.h HAVE_QTGUI_CONFIG_H)
    

    I call CMake like this:

    "C:\Program Files\CMake\bin\cmake.exe" --debug-trycompile -S "./src" -G "Visual Studio 17 2022" -DQt6_DIR="C:/Qt/6.6.0/msvc2019_64/lib/cmake/Qt6" -DQt6GuiTools_DIR="C:/Qt/6.6.0/msvc2019_64/lib/cmake/Qt6GuiTools" -B "./bld"
    

    I get 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.
    

    I have debugged it and can confidently say that it comes from the variable mentioned in the title.
    I am confused about this, is this an CMake issue? Or Qt? Or am I using it wrong? Is this a bug?
    Any help appreciated.

    C 1 Reply Last reply
    0
    • G Gertio

      Hello,

      I have an understanding problem with this variable, basically the following CMake minimal example configuration fails:

      cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
      include(CheckIncludeFileCXX)
      
      project(CMake LANGUAGES CXX)
      find_package(Qt6 REQUIRED COMPONENTS Core Widgets Gui)
      set(CMAKE_REQUIRED_INCLUDES ${Qt6Core_INCLUDE_DIRS})
      check_include_file_cxx(QtGui/qtgui-config.h HAVE_QTGUI_CONFIG_H)
      

      I call CMake like this:

      "C:\Program Files\CMake\bin\cmake.exe" --debug-trycompile -S "./src" -G "Visual Studio 17 2022" -DQt6_DIR="C:/Qt/6.6.0/msvc2019_64/lib/cmake/Qt6" -DQt6GuiTools_DIR="C:/Qt/6.6.0/msvc2019_64/lib/cmake/Qt6GuiTools" -B "./bld"
      

      I get 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.
      

      I have debugged it and can confidently say that it comes from the variable mentioned in the title.
      I am confused about this, is this an CMake issue? Or Qt? Or am I using it wrong? Is this a bug?
      Any help appreciated.

      C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @Gertio said in Why does ${Qt6Core_INCLUDE_DIRS} contain Qt6::ZlibPrivate?:

      the following CMake minimal example configuration fails:

      Where did this come from? What are you trying to build?

      Why does ${Qt6Core_INCLUDE_DIRS} contain Qt6::ZlibPrivate?

      Qt6, by default, is built with a private copy of Zlib and some other libraries.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved