Mercurial > projects > qtd
comparison generator/main.h @ 4:0a29ce1ae854
CMake build script.
Small fixes in examples.
author | SokoL_SD |
---|---|
date | Wed, 13 May 2009 19:01:55 +0000 |
parents | e78566595089 |
children | 347e4c7a9ba1 |
comparison
equal
deleted
inserted
replaced
3:323efbe5c2f7 | 4:0a29ce1ae854 |
---|---|
47 #include <QFile> | 47 #include <QFile> |
48 #include <QDir> | 48 #include <QDir> |
49 | 49 |
50 struct Preprocess | 50 struct Preprocess |
51 { | 51 { |
52 static bool preprocess(const QString &sourceFile, const QString &targetFile, const QString &commandLineIncludes = QString()) | 52 static bool preprocess(const QString &sourceFile, const QString &targetFile, const QString &commandLineIncludes = QString(), |
53 QString qtdir = QString(), QString qtdir_inc = QString()) | |
53 { | 54 { |
54 rpp::pp_environment env; | 55 rpp::pp_environment env; |
55 rpp::pp preprocess(env); | 56 rpp::pp preprocess(env); |
56 | 57 |
57 rpp::pp_null_output_iterator null_out; | 58 rpp::pp_null_output_iterator null_out; |
84 // Includes from the command line | 85 // Includes from the command line |
85 if (!commandLineIncludes.isEmpty()) | 86 if (!commandLineIncludes.isEmpty()) |
86 includes += commandLineIncludes.split(path_splitter); | 87 includes += commandLineIncludes.split(path_splitter); |
87 | 88 |
88 // Include Qt | 89 // Include Qt |
89 QString qtdir_inc = getenv ("QTDIR_INC"); | 90 if (qtdir.isEmpty()) |
90 QString qtdir = getenv ("QTDIR"); | 91 qtdir = getenv ("QTDIR"); |
92 if (qtdir_inc.isEmpty()) | |
93 qtdir_inc = getenv ("QTDIR_INC"); | |
91 if (qtdir.isEmpty() && qtdir_inc.isEmpty()) { | 94 if (qtdir.isEmpty() && qtdir_inc.isEmpty()) { |
92 qWarning("QTDIR and(or) QTDIR_INC environment variables not set. This may cause problems with finding the necessary include files."); | 95 qWarning("QTDIR and QTDIR_INC environment variables not set. This may cause problems with finding the necessary include files."); |
93 } else { | 96 } else { |
94 if (qtdir_inc.isEmpty()) | 97 if (qtdir_inc.isEmpty()) |
95 qtdir_inc = qtdir + "/include"; | 98 qtdir_inc = qtdir + "/include"; |
96 includes << (qtdir_inc + "/QtXml"); | 99 includes << (qtdir_inc + "/QtXml"); |
97 includes << (qtdir_inc + "/QtNetwork"); | 100 includes << (qtdir_inc + "/QtNetwork"); |
98 includes << (qtdir_inc + "/QtCore"); | 101 includes << (qtdir_inc + "/QtCore"); |
99 includes << (qtdir_inc + "/QtGui"); | 102 includes << (qtdir_inc + "/QtGui"); |
100 includes << (qtdir_inc + "/QtOpenGL"); | 103 includes << (qtdir_inc + "/QtOpenGL"); |
101 includes << qtdir_inc; | 104 includes << qtdir_inc; |
102 } | 105 } |
103 | |
104 | 106 |
105 foreach (QString include, includes) | 107 foreach (QString include, includes) |
106 preprocess.push_include_path(QDir::convertSeparators(include).toStdString()); | 108 preprocess.push_include_path(QDir::convertSeparators(include).toStdString()); |
107 | 109 |
108 QString currentDir = QDir::current().absolutePath(); | 110 QString currentDir = QDir::current().absolutePath(); |