浏览代码

Fix build of ctkQtTesting application and CTKConfig include directory export.

This commit fixes the build of ctkQtTesting application. By ensuring that
the functions "ctkFunctionGet(Include|Lib)Dirs" can be used for CTKQtTesting,
it fixes the build system and makes the statement done in commit 0233954
true.

It leverages the mechanism allowing to specify optional dependencies
(introduced in 3facf6a2)
Jean-Christophe Fillion-Robin 11 年之前
父节点
当前提交
f1b73a3900
共有 2 个文件被更改,包括 8 次插入14 次删除
  1. 8 0
      CMakeLists.txt
  2. 0 14
      Libs/QtTesting/CMakeLists.txt

+ 8 - 0
CMakeLists.txt

@@ -823,6 +823,14 @@ if(CTK_LIB_Scripting/Python/Core AND CTK_LIB_Scripting/Python/Core_PYTHONQT_USE_
   set(ctkSimplePythonShell_OPTIONAL_DEPENDENCIES CTKVisualizationVTKCore VTK_LIBRARIES)
 endif()
 
+set(CTKQtTesting_OPTIONAL_DEPENDENCIES)
+if(CTK_LIB_Widgets)
+  list(APPEND CTKQtTesting_OPTIONAL_DEPENDENCIES CTKWidgets)
+endif()
+if(CTK_LIB_Visualization/VTK/Widgets)
+  list(APPEND CTKQtTesting_OPTIONAL_DEPENDENCIES CTKVisualizationVTKWidgets)
+endif()
+
 #-----------------------------------------------------------------------------
 # Let's make sure the enabled/disabled libraries, plugins or applications are coherent
 #

+ 0 - 14
Libs/QtTesting/CMakeLists.txt

@@ -108,13 +108,6 @@ if (CTK_LIB_Widgets)
   set(CTK_ADD_WIDGET_EVENT_TRANSLATORS "${CTK_ADD_WIDGET_EVENT_TRANSLATORS}  this->eventTranslator()->addWidgetEventTranslator(new ctkFileDialogEventTranslator(util));\n")
 endif()
 
-foreach(libname ${CTK_ENABLED_LIBNAMES})
-  include_directories(
-    ${${libname}_SOURCE_DIR}
-    ${${libname}_BINARY_DIR}
-    )
-endforeach()
-
 configure_file(
   ctkQtTestingUtility.cpp.in
   ${CMAKE_CURRENT_BINARY_DIR}/ctkQtTestingUtility.cpp
@@ -157,13 +150,6 @@ set(QtTesting_LIBRARIES QtTesting)
 # The following macro will read the target libraries from the file 'target_libraries.cmake'
 ctkFunctionGetTargetLibraries(KIT_target_libraries)
 
-# List of dependency is dynamically generated based the list enabled libraries.
-foreach(libname ${CTK_ENABLED_LIBNAMES})
-  if(${libname} MATCHES "Widgets$")
-    list(APPEND KIT_target_libraries ${libname})
-  endif()
-endforeach()
-
 ctkMacroBuildLib(
   NAME ${PROJECT_NAME}
   EXPORT_DIRECTIVE ${KIT_export_directive}