Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.6.0
-
None
-
-
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.