Pārlūkot izejas kodu

ctkSimplePythonQtDecorator - Conditionally include dependent decorators

This will solve the compilation error happening when
ctkSimplePythonshell is built with CTK_WRAP_PYTHONQT_LIGHT OFF
Jean-Christophe Fillion-Robin 14 gadi atpakaļ
vecāks
revīzija
8e971ab3a5

+ 11 - 2
Applications/ctkSimplePythonShell/ctkSimplePythonQtDecorators.h

@@ -3,9 +3,14 @@
 #define __ctkSimplePythonQtDecorators_h
 
 // CTK includes
+#include "ctkSimplePythonShellConfigure.h" // For CTK_WRAP_PYTHONQT_LIGHT
 #include <ctkAbstractPythonManager.h>
-#include <ctkCorePythonQtDecorators.h>
-#include <ctkWidgetsPythonQtDecorators.h>
+#ifdef CTK_WRAP_PYTHONQT_LIGHT
+# include <ctkCorePythonQtDecorators.h>
+# include <ctkWidgetsPythonQtDecorators.h>
+#endif
+
+// PythonQt includes
 #include <PythonQt.h>
 
 // NOTE:
@@ -24,8 +29,12 @@ public:
   ctkSimplePythonQtDecorators(ctkAbstractPythonManager* pythonManager)
     {
     Q_ASSERT(pythonManager);
+#ifdef CTK_WRAP_PYTHONQT_LIGHT
     pythonManager->registerPythonQtDecorator(new ctkCorePythonQtDecorators);
     pythonManager->registerPythonQtDecorator(new ctkWidgetsPythonQtDecorators);
+#else
+    Q_UNUSED(pythonManager);
+#endif
     }
 
 public slots: