瀏覽代碼

Merge branch '418-support-use-system-option'

* 418-support-use-system-option:
  Fix CTK build when not all plugins/apps/libraries are enabled.
Jean-Christophe Fillion-Robin 11 年之前
父節點
當前提交
a91b2b21a9
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      CMakeLists.txt

+ 7 - 3
CMakeLists.txt

@@ -953,9 +953,13 @@ endif()
 # Expand variables containing include and library directories for external projects
 # This relies on the variable EXTERNAL_TARGETS set in ctkMacroValidateBuildOptions
 foreach(_external_target ${EXTERNAL_TARGETS})
-  if(${_external_target}_FIND_PACKAGE_CMD)
-    #message("Calling find_package(${${_external_target}_FIND_PACKAGE_CMD})")
-    find_package(${${_external_target}_FIND_PACKAGE_CMD} REQUIRED)
+  set(_package_name ${${_external_target}_FIND_PACKAGE_CMD})
+  if(_package_name)
+    superbuild_is_external_project_includable(${_package_name} required)
+    if(required)
+      #message("Calling find_package(${_package_name})")
+      find_package(${_package_name} REQUIRED)
+    endif()
   endif()
 endforeach()