소스 검색

Fix pluginframework build error happening when wrapping is enabled.

This commit fixes the error reported below by adding to the wrapper header
file only the header of classes associated with "wrappable" classes.

Fixes #455

8<----8<----8<----8<----8<----8<----8<----8<----8<----
[ 12%] Built target CTKPluginFramework
[ 12%] Building CXX object Libs/PluginFramework/CMakeFiles/CTKPluginFrameworkPythonQt.dir/generated_cpp/org_commontk_CTKPluginFramework/org_commontk_CTKPluginFramework_init.cpp.o
In file included from /home/jchris/Projects/CTK-build/CTK-build/Libs/PluginFramework/generated_cpp/org_commontk_CTKPluginFramework/org_commontk_CTKPluginFramework_init.cpp:7:0:
/home/jchris/Projects/CTK-build/CTK-build/Libs/PluginFramework/generated_cpp/org_commontk_CTKPluginFramework/org_commontk_CTKPluginFramework.h:17:38: fatal error: ctkConfigurationListener.h: No such file or directory
 #include "ctkConfigurationListener.h"
                                      ^
compilation terminated.
8<----8<----8<----8<----8<----8<----8<----8<----8<----
Jean-Christophe Fillion-Robin 11 년 전
부모
커밋
51552a0e6b
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      CMake/ctkWrapPythonQt.py

+ 4 - 3
CMake/ctkWrapPythonQt.py

@@ -64,8 +64,6 @@ def ctk_wrap_pythonqt(target, namespace, output_dir, input_files, extra_verbose)
        
         # what is the filename without the extension
         filename_we = os.path.splitext(filename)[0]
-        
-        includes.append('#include "%s.h"' % filename_we)
 
         # Extract classname - NOTE: We assume the filename matches the associated class
         className = filename_we
@@ -133,7 +131,10 @@ def ctk_wrap_pythonqt(target, namespace, output_dir, input_files, extra_verbose)
                     parentClassName = "QWidget"
                     if extra_verbose:
                         print("\tconstructor of the form: %s(QWidget * parent ... )" % className)
-                        
+
+        if parentClassName is not None:
+            includes.append('#include "%s.h"' % filename_we)
+
         # Generate PythonQtWrapper class
         if parentClassName == "QObject" or parentClassName == "QWidget":
             pythonqtWrappers.append(