Bug 225154 - Fix QtGuess.txt for Windows and qfeatures.h
Summary: Fix QtGuess.txt for Windows and qfeatures.h
Status: CONFIRMED
Alias: None
Product: bindings
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: kde-bindings
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-01 16:32 UTC by rmelton
Modified: 2021-03-09 05:24 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.