浏览代码

Compile QtTesting with no Widget support

QtTesting requires Widgets to compile successfully
Julien Finet 13 年之前
父节点
当前提交
8dd54152dd
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 1 1
      CMakeLists.txt
  2. 5 1
      Libs/QtTesting/CMakeLists.txt

+ 1 - 1
CMakeLists.txt

@@ -435,7 +435,7 @@ ctk_lib_option(PluginFramework
 
 ctk_lib_option(Widgets
                "Build the Widgets library" OFF
-               CTK_ENABLE_Widgets OR (CTK_ENABLE_DICOMApplicationHosting AND CTK_BUILD_EXAMPLES))
+               CTK_ENABLE_Widgets OR (CTK_ENABLE_DICOMApplicationHosting AND CTK_BUILD_EXAMPLES) OR CTK_USE_QTTESTING)
                
 ctk_lib_option(DICOM/Core
                "Build the DICOM Core library" OFF

+ 5 - 1
Libs/QtTesting/CMakeLists.txt

@@ -76,7 +76,9 @@ foreach(CTK_HEADER_EVENT_PLAYERS ${CTK_HEADERS_EVENT_PLAYERS})
   endif()
 endforeach()
 
+if(CTK_LIB_Widgets)
 set(CTK_ADD_WIDGET_EVENT_PLAYERS "${CTK_ADD_WIDGET_EVENT_PLAYERS}  this->eventPlayer()->addWidgetEventPlayer(new ctkFileDialogEventPlayer(util));\n")
+endif()
 
 set(CTK_ADD_HEADER_EVENT_TRANSLATORS "// Event translator includes\n")
 #set(CTK_ADD_WIDGET_EVENT_TRANSLATORS)
@@ -101,7 +103,9 @@ foreach(CTK_HEADER_EVENT_TRANSLATORS ${CTK_HEADERS_EVENT_TRANSLATORS})
   endif()
 endforeach()
 
-set(CTK_ADD_WIDGET_EVENT_TRANSLATORS "${CTK_ADD_WIDGET_EVENT_TRANSLATORS}  this->eventTranslator()->addWidgetEventTranslator(new ctkFileDialogEventTranslator(util));\n")
+if (CTK_LIB_Widgets)
+  set(CTK_ADD_WIDGET_EVENT_TRANSLATORS "${CTK_ADD_WIDGET_EVENT_TRANSLATORS}  this->eventTranslator()->addWidgetEventTranslator(new ctkFileDialogEventTranslator(util));\n")
+endif()
 
 set(KIT_INCLUDE_DIRECTORIES
   ${QtTesting_INCLUDE_DIRS}