Browse Source

ENH: Scripting/Python/Core library is now using library option setup in ctk_library_options file.

These options corresponds to the different QtModule that could be wrap within
PythonQt.
Jean-Christophe Fillion-Robin 15 years ago
parent
commit
28a42cd4b1

+ 3 - 4
CMakeExternals/PythonQt.cmake

@@ -15,12 +15,11 @@ IF(${add_project})
   #   MESSAGE(STATUS "Adding project:${proj}")
     SET(PythonQt_DEPENDS ${proj})
     
-    # Expose PythonQt options
+    # Generate ep_PythonQt_args
     SET(ep_PythonQt_args)
     foreach(qtlib gui network opengl sql svg uitools webkit xml xmlpatterns)
-      OPTION(CTK_PythonQt_Wrap_Qt${qtlib} "Make all of Qt${qtlib} available in python" OFF)
-      MARK_AS_ADVANCED(CTK_PythonQt_Wrap_Qt${qtlib})
-      LIST(APPEND ep_PythonQt_args -DPythonQt_Wrap_Qt${qtlib}:BOOL=${CTK_PythonQt_Wrap_Qt${qtlib}})
+      STRING(TOUPPER ${qtlib} qtlib_uppercase)
+      LIST(APPEND ep_PythonQt_args -DPythonQt_Wrap_Qt${qtlib}:BOOL=${CTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QT${qtlib_uppercase}})
     endforeach()
 
     # Python is required

+ 4 - 4
Libs/Scripting/Python/Core/CMakeLists.txt

@@ -43,13 +43,13 @@ SET(KIT_resources
 #
 # Configure file describing which Qt modules are wrapped
 #
-FOREACH(qtlib gui network opengl sql svg uitools webkit xml xmlpatterns)
-  STRING(TOUPPER ${qtlib} qtlib_uppercase)
-  SET(CTK_PYTHONQT_WRAP_QT${qtlib_uppercase} ${CTK_PythonQt_Wrap_Qt${qtlib}})
+FOREACH(qtlib GUI NETWORK OPENGL SQL SVG UITOOLS WEBKIT XML XMLPATTERNS)
+  SET(CTK_PYTHONQT_WRAP_QT${qtlib} ${CTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QT${qtlib}})
+  #message(CTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QT${qtlib}:${CTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QT${qtlib}})
 ENDFOREACH()
 
 # TODO Ideally a file named ctkScripingPythonWidgetsConfigure.h should
-# also be configured, this file should deal with module depending only on QtGui
+# also be configured, this file should deal with Qt Module depending only on QtGui
 
 CONFIGURE_FILE(
   ctkScriptingPythonCoreConfigure.h.in

+ 18 - 0
Libs/Scripting/Python/Core/ctk_library_options.cmake

@@ -0,0 +1,18 @@
+#
+# See CMake/ctkMacroAddCtkLibraryOptions.cmake
+#
+# This file should list of options available for considered CTK library
+# For example: MYOPT1:OFF MYOPT2:ON
+#
+
+SET(ctk_library_options
+  PYTHONQT_WRAP_QTGUI:OFF
+  PYTHONQT_WRAP_QTNETWORK:OFF
+  PYTHONQT_WRAP_QTOPENGL:OFF
+  PYTHONQT_WRAP_QTSQL:OFF
+  PYTHONQT_WRAP_QTSVG:OFF
+  PYTHONQT_WRAP_QTUITOOLS:OFF
+  PYTHONQT_WRAP_QTWEBKIT:OFF
+  PYTHONQT_WRAP_QTXML:OFF
+  PYTHONQT_WRAP_QTXMLPATTERNS:OFF
+  )