summaryrefslogtreecommitdiff
path: root/Source/QtDialog/QCMake.h
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2007-11-02 11:50:17 -0400
committerClinton Stimpson <clinton@elemtech.com>2007-11-02 11:50:17 -0400
commit800cbd0550466794cf853c6fb4dc0349e245220c (patch)
tree6a55206bc76ac9a72f99906f341a8b7115879f8d /Source/QtDialog/QCMake.h
parentdcf21dd90b816d06b43716ce96e496fe3d591594 (diff)
downloadcmake-800cbd0550466794cf853c6fb4dc0349e245220c.tar.gz
ENH: Beginnings of a Qt UI for CMake.
Diffstat (limited to 'Source/QtDialog/QCMake.h')
-rw-r--r--Source/QtDialog/QCMake.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
new file mode 100644
index 0000000000..1e4b6614ff
--- /dev/null
+++ b/Source/QtDialog/QCMake.h
@@ -0,0 +1,78 @@
+
+#ifndef __QCMake_h
+#define __QCMake_h
+
+#include <QObject>
+#include <QString>
+#include <QList>
+#include <QMetaType>
+
+class cmake;
+
+// struct to represent cache properties in Qt
+struct QCMakeCacheProperty
+{
+ enum PropertyType { BOOL, PATH, FILEPATH, STRING };
+ QString Key;
+ QString Value;
+ QString Help;
+ PropertyType Type;
+ bool Advanced;
+};
+
+// make types usable with QVariant
+Q_DECLARE_METATYPE(QCMakeCacheProperty)
+typedef QList<QCMakeCacheProperty> QCMakeCachePropertyList;
+Q_DECLARE_METATYPE(QCMakeCachePropertyList)
+
+// Qt API for CMake library.
+// Wrapper like class allows for easier integration with
+// Qt features such as, signal/slot connections, multi-threading, etc..
+class QCMake : public QObject
+{
+ Q_OBJECT
+public:
+ QCMake(QObject* p=0);
+ ~QCMake();
+
+public slots:
+ void loadCache(const QString& dir);
+ void setSourceDirectory(const QString& dir);
+ void setBinaryDirectory(const QString& dir);
+ void setGenerator(const QString& generator);
+ void configure();
+ void generate();
+ void setProperties(const QCMakeCachePropertyList&);
+ void interrupt();
+
+public:
+ QCMakeCachePropertyList properties();
+ QString binaryDirectory();
+ QString sourceDirectory();
+ QString generator();
+
+signals:
+ void propertiesChanged(const QCMakeCachePropertyList& vars);
+ void generatorChanged(const QString& gen);
+ void error(const QString& title, const QString& message, bool*);
+ void sourceDirChanged(const QString& dir);
+ void progressChanged(const QString& msg, float percent);
+ void configureDone(int error);
+ void generateDone(int error);
+ void configureReady();
+ void generateReady();
+
+protected:
+ cmake* CMakeInstance;
+
+ static void progressCallback(const char* msg, float percent, void* cd);
+ static void errorCallback(const char* msg, const char* title, bool&, void* cd);
+
+ QString SourceDirectory;
+ QString BinaryDirectory;
+ QString Generator;
+ QString CMakeExecutable;
+};
+
+#endif // __QCMake_h
+