Commit 8cdb52ef authored by Jeff Baumes's avatar Jeff Baumes
Browse files

COMP: Excluding (through preprocessor commands) classes and test that depend...

COMP: Excluding (through preprocessor commands) classes and test that depend on Qt's SQL module for editions that do not contain it.  There is not currently a clean way to do this in CMake.
parent bb57cd34
......@@ -18,6 +18,9 @@
----------------------------------------------------------------------------*/
// Tests vtkQtSQLDatabase.
// Check for Qt SQL module before defining this test.
#include <qglobal.h>
#if (QT_EDITION & QT_MODULE_SQL)
#include "vtkQtSQLDatabase.h"
#include "vtkSQLQuery.h"
#include "vtkRowQueryToTable.h"
......@@ -271,6 +274,13 @@ int TestQtSQLDatabase(int argc, char* argv[])
reader->Delete();
query->Delete();
db->Delete();
return 0;
}
#else
#include "vtkObject.h" // for cerr.
int TestQtSQLDatabase(int, char*[])
{
cerr << "QT_MODULE_SQL not enabled in this edition, so nothing to test." << endl;
return 0;
}
#endif // (QT_EDITION & QT_MODULE_SQL)
......@@ -17,6 +17,10 @@
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
----------------------------------------------------------------------------*/
// Check for Qt SQL module before defining this class.
#include <qglobal.h>
#if (QT_EDITION & QT_MODULE_SQL)
#include "vtkQtSQLDatabase.h"
#include "vtkObjectFactory.h"
......@@ -28,7 +32,7 @@
#include <QtSql/QtSql>
#include <QtSql/QSqlError>
vtkCxxRevisionMacro(vtkQtSQLDatabase, "1.1");
vtkCxxRevisionMacro(vtkQtSQLDatabase, "1.2");
vtkStandardNewMacro(vtkQtSQLDatabase);
int vtkQtSQLDatabase::id = 0;
......@@ -257,3 +261,4 @@ vtkStdString vtkQtSQLDatabase::GetURL()
return url;
}
#endif // (QT_EDITION & QT_MODULE_SQL)
......@@ -24,6 +24,10 @@
#ifndef __vtkQtSQLDatabase_h
#define __vtkQtSQLDatabase_h
// Check for Qt SQL module before defining this class.
#include <qglobal.h>
#if (QT_EDITION & QT_MODULE_SQL)
#include "QVTKWin32Header.h"
#include "vtkSQLDatabase.h"
......@@ -166,5 +170,6 @@ private:
void operator=(const vtkQtSQLDatabase &); // Not implemented.
};
#endif // (QT_EDITION & QT_MODULE_SQL)
#endif // __vtkQtSQLDatabase_h
......@@ -17,6 +17,10 @@
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
----------------------------------------------------------------------------*/
// Check for Qt SQL module before defining this class.
#include <qglobal.h>
#if (QT_EDITION & QT_MODULE_SQL)
#include "vtkQtSQLQuery.h"
#include "vtkCharArray.h"
......@@ -42,7 +46,7 @@ public:
};
vtkCxxRevisionMacro(vtkQtSQLQuery, "1.1");
vtkCxxRevisionMacro(vtkQtSQLQuery, "1.2");
vtkStandardNewMacro(vtkQtSQLQuery);
vtkQtSQLQuery::vtkQtSQLQuery()
......@@ -223,3 +227,4 @@ vtkVariant vtkQtSQLQuery::DataValue(vtkIdType c)
}
}
#endif // (QT_EDITION & QT_MODULE_SQL)
......@@ -24,6 +24,10 @@
#ifndef __vtkQtSQLQuery_h
#define __vtkQtSQLQuery_h
// Check for Qt SQL module before defining this class.
#include <qglobal.h>
#if (QT_EDITION & QT_MODULE_SQL)
#include "QVTKWin32Header.h"
#include "vtkSQLQuery.h"
#include "vtkType.h"
......@@ -94,5 +98,6 @@ private:
void operator=(const vtkQtSQLQuery &); // Not implemented.
};
#endif // (QT_EDITION & QT_MODULE_SQL)
#endif // __vtkQtSQLQuery_h
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment