Bug 225154

Summary: Fix QtGuess.txt for Windows and qfeatures.h
Product: [Developer tools] bindings Reporter: rmelton
Component: generalAssignee: kde-bindings
Status: CONFIRMED ---    
Severity: normal CC: arno, dpalacio
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description rmelton 2010-02-01 16:32:59 UTC
Version:            (using Devel)
Compiler:          gcc4 
OS:                MS Windows
Installed from:    Compiled sources

This change will allow QtGuess.txt to work correctly on Windows.  Because windows has no symlinks, the Windows SDK uses #include inside of its header files to "link" to the real location of qconfig.h, qglobal.h, and qfeatures.h.

Note: This affects both the qt and the qtcore QtGuess.txt files and that changing "qfeatures" to "qfeatures_h" in the set line affects all operating systems.

Is at line 109:

file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qglobal.h" qglobal_h NEWLINE_CONSUME)
file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qconfig.h" qconfig_h NEWLINE_CONSUME)
file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qfeatures.h" qfeatures_h NEWLINE_CONSUME)
set(qtheaders "${qglobal_h}\n${qconfig_h}\n${qfeatures}")

Should Be:

if(WIN32)
  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/../../src/corelib/global/qglobal.h" qglobal_h NEWLINE_CONSUME)
  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/../../src/corelib/global/qconfig.h" qconfig_h NEWLINE_CONSUME)
  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/../../src/corelib/global/qfeatures.h" qfeatures_h NEWLINE_CONSUME)
else(WIN32)
  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qglobal.h" qglobal_h NEWLINE_CONSUME)
  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qconfig.h" qconfig_h NEWLINE_CONSUME)
  file(STRINGS "${QT_QTCORE_INCLUDE_DIR}/qfeatures.h" qfeatures_h NEWLINE_CONSUME)
endif(WIN32)
set(qtheaders "${qglobal_h}\n${qconfig_h}\n${qfeatures_h}")
Comment 1 Arno Rehn 2010-02-01 20:19:14 UTC
This is not true for every Qt install. The one that ships with the KDE for windows installer has a *nix like directory structure, where all headers are in include/Qt*. Consequently, there is no src directory which contains the "real" headers.
The correct approach would probably be to parse the first line of the headers and then open the right file.
Comment 2 David Palacio 2010-02-03 00:38:21 UTC
This could be a cached variable called (e.g. QTGUESS_CONFIG_HEADERS) where you can set the correct directory. A test could set it automatically too.
Comment 3 Justin Zobel 2021-03-09 05:24:42 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.