From e28784c1bf6a1147e3d6529617d18ae5378d4d33 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20K=C3=BCmmel?= Date: Fri, 18 Jul 2008 14:59:22 +0200 Subject: [PATCH] various portability fixes * changed the name of the environment variable from QTDIR to QT_INCLUDE * convert path using the correct separator --- BUILD | 8 ++++++-- cpptoxml/main.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/BUILD b/BUILD index 3249d88..7b437ad 100644 --- a/BUILD +++ b/BUILD @@ -36,8 +36,8 @@ echo '#include ' > ./src/qtgui.cpp ./cpptoxml/cpptoxml -C cpptoxml/parser/rpp/pp-qt-configuration ./src/qtgui.cpp > src/qtgui.xml -Rememebr that you have to set the QTDIR env variable such that -$QTDIR contains the QtCore, QtGui, etc... directories +Rememebr that you have to set the QT_INCLUDE env variable such that +$QT_INCLUDE contains the QtCore, QtGui, etc... directories The same command could be issued directly on the header file e.g. @@ -50,6 +50,10 @@ instead of mkdir qtgui_src lua generator/generator.lua src/qtgui.xml -i '' -n qtgui -t generator/types.lua -t generator/qtypes.lua -f generator/qt_internal.lua +on windows use the command: +lua generator\generator.lua src\qtgui.xml -i '' -n qtgui -t generator\types.lua -t generator\qtypes.lua -f generator\qt_internal.lua + + The options tell the generator which is the name of the module (-n), which type definitions to use (-t), which files must be included in the final binding (-i), how to filter out diff --git a/cpptoxml/main.cpp b/cpptoxml/main.cpp index 62a1cfc..2dbf6fc 100644 --- a/cpptoxml/main.cpp +++ b/cpptoxml/main.cpp @@ -376,7 +376,7 @@ int main (int argc, char **argv) { int i; if ((i=options.indexOf("-C"))!=-1) { if (options.count() > i+1) { - configName = options.at(i+1); + configName = QDir::fromNativeSeparators(options.at(i+1)); options.removeAt(i+1); } options.removeAt(i); @@ -390,16 +390,16 @@ int main (int argc, char **argv) { options.removeAt(i); } if (options.count()>1) return 37; - sourceName = options.at(0); + sourceName = QDir::fromNativeSeparators(options.at(0)); QByteArray contents; Preprocessor pp; QStringList inclist; - QString qtdir = getenv ("QTDIR"); + QString qtdir = QDir::fromNativeSeparators(getenv("QT_INCLUDE")); if (qtdir.isEmpty()) { - fprintf(stderr, "Generator requires QTDIR to be set\n"); + fprintf(stderr, "Generator requires QT_INCLUDE to be set\n"); return false; } -- 2.11.4.GIT