瀏覽代碼

New CTK_ENABLE_* build system feature.

The CTK CMake configuration now shows only high-level options
representing the main features of the toolkit. All other options
are marked as advanced.

Some options have been renamed to include the CTK_ prefix.
Sascha Zelzer 13 年之前
父節點
當前提交
ed4b1ada78

+ 4 - 16
CMake/ctkBlockCheckDependencies.cmake

@@ -13,9 +13,9 @@
 # Collect CTK library target dependencies
 #
 
-ctkMacroCollectAllTargetLibraries("${CTK_LIBS_SUBDIRS}" "Libs" ALL_TARGET_LIBRARIES)
-ctkMacroCollectAllTargetLibraries("${CTK_PLUGINS_SUBDIRS}" "Plugins" ALL_TARGET_LIBRARIES)
-ctkMacroCollectAllTargetLibraries("${CTK_APPLICATIONS_SUBDIRS}" "Applications" ALL_TARGET_LIBRARIES)
+ctkMacroCollectAllTargetLibraries("${CTK_LIBS}" "Libs" ALL_TARGET_LIBRARIES)
+ctkMacroCollectAllTargetLibraries("${CTK_PLUGINS}" "Plugins" ALL_TARGET_LIBRARIES)
+ctkMacroCollectAllTargetLibraries("${CTK_APPS}" "Applications" ALL_TARGET_LIBRARIES)
 #message(STATUS ALL_TARGET_LIBRARIES:${ALL_TARGET_LIBRARIES})
 
 #-----------------------------------------------------------------------------
@@ -25,19 +25,7 @@ ctkMacroCollectAllTargetLibraries("${CTK_APPLICATIONS_SUBDIRS}" "Applications" A
 # of the macro ctkMacroCollectAllTargetLibraries, let's get the list of all Non-CTK dependencies.
 # NON_CTK_DEPENDENCIES is expected by the macro ctkMacroShouldAddExternalProject
 ctkMacroGetAllNonProjectTargetLibraries("${ALL_TARGET_LIBRARIES}" NON_CTK_DEPENDENCIES)
-#message(STATUS NON_CTK_DEPENDENCIES:${NON_CTK_DEPENDENCIES})
-
-#-----------------------------------------------------------------------------
-# Include external projects
-#
-#-----------------------------------------------------------------------------
-# Git protocole option
-#
-option(CTK_USE_GIT_PROTOCOL "If behind a firewall turn this OFF to use http instead." ON)
-set(git_protocol "git")
-if(NOT CTK_USE_GIT_PROTOCOL)
-  set(git_protocol "http")
-endif()
+#message(NON_CTK_DEPENDENCIES:${NON_CTK_DEPENDENCIES})
 
 #-----------------------------------------------------------------------------
 # Enable and setup External project global properties

+ 42 - 0
CMake/ctkMacroOptionUtils.cmake

@@ -0,0 +1,42 @@
+macro(ctk_option option_prefix name doc default)
+  option(${option_prefix}_${name} ${doc} ${default})
+  mark_as_advanced(${option_prefix}_${name})
+  list(APPEND ${option_prefix}S ${name})
+  set(_logical_expr ${ARGN})
+  if(_logical_expr AND NOT ${option_prefix}_${name})
+    if(${ARGN})
+      # Force the option to ON. This is okay since the
+      # logical expression should contain a CTK_ENABLE_*
+      # option value, which requires the current option to be ON.
+      get_property(_doc_string CACHE ${option_prefix}_${name} PROPERTY HELPSTRING)
+      set(${option_prefix}_${name} ON CACHE BOOL ${_doc_string} FORCE)
+      message("Enabling [${option_prefix}_${name}] because of [${ARGN}]")
+    endif()
+  endif()
+endmacro()
+
+macro(ctk_lib_option name doc default)
+  ctk_option(CTK_LIB ${name} ${doc} ${default} ${ARGN})
+endmacro()
+
+macro(ctk_plugin_option name doc default)
+  ctk_option(CTK_PLUGIN ${name} ${doc} ${default} ${ARGN})
+endmacro()
+
+macro(ctk_app_option name doc default)
+  ctk_option(CTK_APP ${name} ${doc} ${default} ${ARGN})
+endmacro()
+
+macro(ctk_enable_option name doc default)
+  option(CTK_ENABLE_${name} "${doc}" ${default})
+  if(DEFINED CTK_ENABLE_${name}_internal)
+    if(${CTK_ENABLE_${name}} AND ${CTK_ENABLE_${name}_internal})
+      if(NOT (${ARGN}))
+        get_property(_doc_string CACHE CTK_ENABLE_${name} PROPERTY HELPSTRING)
+        set(CTK_ENABLE_${name} OFF CACHE BOOL ${_doc_string} FORCE)
+        message("Full support for [${name}] disabled")
+      endif()
+    endif()
+  endif()
+  set(CTK_ENABLE_${name}_internal ${CTK_ENABLE_${name}} CACHE INTERNAL "" FORCE)
+endmacro()

+ 7 - 7
CMake/ctkMacroTargetLibraries.cmake

@@ -222,17 +222,17 @@ macro(ctkMacroGetAllNonProjectTargetLibraries all_target_libraries varname)
     list(REMOVE_ITEM _tmp_list ${all_project_libraries})
   endif()
   set(${varname} ${_tmp_list})
-  #message(STATUS varname:${varname}:${${varname}})
+  #message(varname:${varname}:${${varname}})
 endmacro()
 
 #! \ingroup CMakeUtilities
 macro(ctkMacroShouldAddExternalProject libraries_variable_name resultvar)
-  if(NOT DEFINED NON_CTK_DEPENDENCIES)
-    message(FATAL_ERROR "Variable NON_CTK_DEPENDENCIES is undefined !")
-  endif() 
-  list(FIND NON_CTK_DEPENDENCIES ${libraries_variable_name} index)
   set(${resultvar} FALSE)
-  if(${index} GREATER -1)
-    set(${resultvar} TRUE)
+  if(DEFINED NON_CTK_DEPENDENCIES)
+    list(FIND NON_CTK_DEPENDENCIES ${libraries_variable_name} index)
+  
+    if(${index} GREATER -1)
+      set(${resultvar} TRUE)
+    endif()
   endif()
 endmacro()

+ 219 - 121
CMakeLists.txt

@@ -74,6 +74,7 @@ endif()
 if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
   message(STATUS "Setting build type to 'Debug' as none was specified.")
   set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
+  mark_as_advanced(CMAKE_BUILD_TYPE)
   # Set the possible values of build type for cmake-gui
   set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
     "MinSizeRel" "RelWithDebInfo")
@@ -178,6 +179,7 @@ set(CTK_CMAKE_UTILITIES_DIR ${CTK_SOURCE_DIR}/Utilities/CMake)
 include(CMake/ctkMacroParseArguments.cmake)
 include(CMake/ctkMacroSetPaths.cmake)
 include(CMake/ctkMacroListFilter.cmake)
+include(CMake/ctkMacroOptionUtils.cmake)
 include(CMake/ctkMacroBuildLib.cmake)
 include(CMake/ctkMacroBuildLibWrapper.cmake)
 include(CMake/ctkMacroBuildPlugin.cmake)
@@ -199,17 +201,10 @@ include(CMake/ctkFunctionGetLibraryDirs.cmake)
 include(CMake/ctkFunctionGetGccVersion.cmake)
 
 #-----------------------------------------------------------------------------
-# Qt Designer Plugins
-
-option(BUILD_QTDESIGNER_PLUGINS "Build Qt Designer plugins" ON)
-if(BUILD_QTDESIGNER_PLUGINS)
-  include(CMake/ctkMacroBuildQtDesignerPlugin.cmake)
-endif()
-
-#-----------------------------------------------------------------------------
 # Testing
 #
-option(BUILD_TESTING "Test the project" ON)
+option(BUILD_TESTING "Test the project" OFF)
+mark_as_advanced(BUILD_TESTING)
 if(BUILD_TESTING)
   enable_testing()
   include(CTest)
@@ -249,6 +244,7 @@ endif()
 # Coverage
 #
 option(WITH_COVERAGE "Enable/Disable coverage" OFF)
+mark_as_advanced(WITH_COVERAGE)
 
 #-----------------------------------------------------------------------------
 # Documentation
@@ -344,73 +340,53 @@ if(QT4_FOUND)
 endif()
 
 #-----------------------------------------------------------------------------
-# CTK Libraries - Use ON or OFF to indicate if the library should be built by default
-#
-set(CTK_LIBS
-  Core:ON
-  PluginFramework:ON
-  Widgets:OFF
-  DICOM/Core:OFF
-  DICOM/Widgets:OFF
-  ImageProcessing/ITK/Core:OFF
-  #Messaging/Core:OFF  # MessagingCore library need some love :) - Let's disable it for now :(
-  #ModuleDescription:OFF # ModuleDescription library need some love :) - Let's disable it for now :(
-  Scripting/Python/Core:OFF
-  Scripting/Python/Widgets:OFF
-  Visualization/VTK/Core:OFF
-  Visualization/VTK/Widgets:OFF
-  #Visualization/XIP:OFF # XIP library need some love :) - Let's disable it for now :(
-  )
+# To make options show up in both CTK-SuperBuild and CTK regular build, let's add them
+# before the SuperBuild script is included
+#
 
 #-----------------------------------------------------------------------------
-# CTK Plugins - Use ON or OFF to indicate if the plugin should be built by default
-#
-set(CTK_PLUGINS
-  # Optional plug-ins implementings interfaces in PluginFramework/service/
-  org.commontk.eventbus:OFF
-  org.commontk.configadmin:OFF
-  org.commontk.eventadmin:OFF
-  org.commontk.log:OFF
-  org.commontk.log4qt:OFF
-  org.commontk.metatype:OFF
-
-  # Plug-ins related to DICOM WG23 (Application Hosting)
-  org.commontk.dah.core:OFF
-  org.commontk.dah.app:OFF
-  org.commontk.dah.host:OFF
-  org.commontk.dah.exampleapp:OFF
-  org.commontk.dah.examplehost:OFF
+# High-Level CTK options
 
-  # Misc
-  org.commontk.plugingenerator.core:OFF
-  org.commontk.plugingenerator.ui:OFF
-  org.commontk.slicermodule:OFF
-  )
+# The ctk_enable_option macro expects a logical expression after the first
+# three arguments. This expression should only contain build option names
+# which belong to leafs in the required dependency tree.
 
-#-----------------------------------------------------------------------------
-# CTK Applications - Use ON or OFF to indicate if the application should be built by default
-#
-set(CTK_APPLICATIONS
-  ctkCLIPluginExplorer:OFF
-  ctkDICOM:OFF
-  ctkDICOMIndexer:OFF
-  ctkDICOMDemoSCU:OFF
-  ctkDICOMQuery:OFF
-  ctkDICOMRetrieve:OFF
-  ctkDICOMQueryRetrieve:OFF
-  ctkExampleHost:OFF
-  ctkExampleHostedApp:OFF
-  ctkEventBusDemo:OFF
-  ctkPluginBrowser:OFF
-  ctkPluginGenerator:OFF
-  ctkDICOMObjectViewer:OFF
-  ctkSimplePythonShell:OFF
-  )
+# The CTK infrastructure for high-level DICOM support. This includes
+# DICOM indexing, networking, and GUI widgets.
+ctk_enable_option(DICOM "Enable default DICOM support" OFF
+                  CTK_LIB_DICOM/Widgets)
+
+# The CTK infrastructure for building a DICOM Part 19 compliant application
+# host and/or hosted application. This will not enable any example plugins
+# or executables (enable CTK_ENABLE_EXAMPLES for that).
+ctk_enable_option(DICOMApplicationHosting "Enable DICOM Part 19 Application Hosting support" OFF
+                  CTK_PLUGIN_org.commontk.dah.host AND CTK_PLUGIN_org.commontk.dah.app)
+
+# The CTK Qt Widgets. This will enable the Qt Widget library only.
+# It might trigger the enabling of other widget libraries in combination
+# with other enabled options.
+ctk_enable_option(Widgets "Enable Qt Widget libraries" OFF
+                  CTK_LIB_Widgets)
+
+# The CTK Plugin Framework, a dynamic component system based on OSGi.
+# This will enable only the framework itself.                  
+ctk_enable_option(PluginFramework "Enable Plugin Framework" OFF
+                  CTK_LIB_PluginFramework)
 
 #-----------------------------------------------------------------------------
-# To make options show up in both CTK-SuperBuild and CTK regular build, let's add them
-# before the SuperBuild script is included
-#
+# Other options
+
+# Build examples
+option(CTK_BUILD_EXAMPLES "Enable examples for CTK components" OFF)
+mark_as_advanced(CTK_BUILD_EXAMPLES)
+
+# Git protocol option
+option(CTK_USE_GIT_PROTOCOL "If behind a firewall turn this OFF to use http instead." ON)
+mark_as_advanced(CTK_USE_GIT_PROTOCOL)
+set(git_protocol "git")
+if(NOT CTK_USE_GIT_PROTOCOL)
+  set(git_protocol "http")
+endif()
 
 # Let's mark as advanced some default properties
 mark_as_advanced(CMAKE_INSTALL_PREFIX)
@@ -418,21 +394,172 @@ mark_as_advanced(DART_TESTING_TIMEOUT)
 
 # KWStyle
 option(CTK_USE_KWSTYLE     "Enable sourcecode-based style tests." OFF)
-#mark_as_advanced(CTK_USE_KWSTYLE)
+mark_as_advanced(CTK_USE_KWSTYLE)
 
-#---------------------------------------------------------------------------
-# Will contain a list of sub-directory without option ON or OFF
+# Qt Designer Plugins
+option(CTK_BUILD_QTDESIGNER_PLUGINS "Build Qt Designer plugins" ON)
+mark_as_advanced(CTK_BUILD_QTDESIGNER_PLUGINS)
+if(CTK_BUILD_QTDESIGNER_PLUGINS)
+  include(CMake/ctkMacroBuildQtDesignerPlugin.cmake)
+endif()
+
+
+
+#-----------------------------------------------------------------------------
+# CTK Libraries
 #
-set(CTK_LIBS_SUBDIRS )
-set(CTK_PLUGINS_SUBDIRS )
-set(CTK_APPLICATIONS_SUBDIRS )
+
+ctk_lib_option(Core
+               "Build the Core library" ON)
+
+ctk_lib_option(PluginFramework
+               "Build the Plugin Framework" OFF
+               CTK_ENABLE_PluginFramework)
+
+ctk_lib_option(Widgets
+               "Build the Widgets library" OFF
+               CTK_ENABLE_Widgets OR (CTK_ENABLE_DICOMApplicationHosting AND CTK_BUILD_EXAMPLES))
+               
+ctk_lib_option(DICOM/Core
+               "Build the DICOM Core library" OFF
+               CTK_ENABLE_DICOM OR (CTK_ENABLE_DICOMApplicationHosting AND CTK_BUILD_EXAMPLES))
+               
+ctk_lib_option(DICOM/Widgets
+               "Build the DICOM Widgets library" OFF
+               CTK_ENABLE_DICOM AND CTK_ENABLE_Widgets OR (CTK_ENABLE_DICOMApplicationHosting AND CTK_BUILD_EXAMPLES))
+               
+ctk_lib_option(ImageProcessing/ITK/Core
+               "Build the ITK Core library" OFF)
+               
+ctk_lib_option(Scripting/Python/Core
+               "Build the Python Core library" OFF
+               CTK_ENABLE_PYTHON_WRAPPING)
+               
+ctk_lib_option(Scripting/Python/Widgets
+               "Build the Python Widgets library" OFF
+               CTK_ENABLE_PYTHON_WRAPPING AND CTK_ENABLE_Widgets)
+               
+ctk_lib_option(Visualization/VTK/Core
+               "Build the VTK Core library" OFF)
+               
+ctk_lib_option(Visualization/VTK/Widgets
+               "Build the VTK Widgets library" OFF)
+               
+#ctk_lib_option(ModuleDescription
+#               "Build the Command Line Module Description library" OFF)
+
+#ctk_lib_option(Visualization/XIP
+#               "Build the XIP library" OFF)
 
 #-----------------------------------------------------------------------------
-# Build options associated with CTK libraries
+# CTK Plugins - none of them is build by default
+#
+
+# Plugins in the list below are not build by default
+set(plugin_list
+  # Optional plug-ins implementings interfaces in PluginFramework/service/
+  org.commontk.eventbus
+  org.commontk.configadmin
+  org.commontk.eventadmin
+  org.commontk.log
+  org.commontk.log4qt
+  org.commontk.metatype
+
+  # Misc
+  org.commontk.plugingenerator.core
+  org.commontk.plugingenerator.ui
+  org.commontk.slicermodule
+  )
+
+foreach(_plugin ${plugin_list})  
+  ctk_plugin_option(${_plugin} "Build the ${_plugin} plugin." OFF)
+endforeach()
+
+# Plug-ins related to DICOM WG23 (Application Hosting)
+ctk_plugin_option(org.commontk.dah.core
+                  "Build the org.commontk.dah.core plugin." OFF
+                  CTK_ENABLE_DICOMApplicationHosting)
+                  
+ctk_plugin_option(org.commontk.dah.app
+                  "Build the org.commontk.dah.app plugin." OFF
+                  CTK_ENABLE_DICOMApplicationHosting)
+                  
+ctk_plugin_option(org.commontk.dah.host
+                  "Build the org.commontk.dah.host plugin." OFF
+                  CTK_ENABLE_DICOMApplicationHosting)
+                  
+ctk_plugin_option(org.commontk.dah.exampleapp
+                  "Build the org.commontk.dah.exampleapp plugin." OFF
+                  CTK_ENABLE_DICOMApplicationHosting AND CTK_BUILD_EXAMPLES)
+                  
+ctk_plugin_option(org.commontk.dah.examplehost
+                  "Build the org.commontk.dah.examplehost plugin." OFF
+                  CTK_ENABLE_DICOMApplicationHosting AND CTK_BUILD_EXAMPLES)
+
+#-----------------------------------------------------------------------------
+# CTK Applications - Use ON or OFF to indicate if the application should be built by default
+#
+ 
+#ctk_app_option(ctkCLIPluginExplorer "Build the CLI Plugin Explorer" OFF)
+
+ctk_app_option(ctkDICOM
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkDICOMIndexer
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkDICOMDemoSCU
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkDICOMQuery
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkDICOMRetrieve
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkDICOMQueryRetrieve
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkExampleHost
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_DICOMApplicationHosting AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkExampleHostedApp
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_DICOMApplicationHosting AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkEventBusDemo
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_PluginFramework AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkPluginBrowser
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_PluginFramework AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkPluginGenerator
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_PluginFramework AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkDICOMObjectViewer
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)
+               
+ctk_app_option(ctkSimplePythonShell
+               "Build the DICOM example application" OFF
+               CTK_ENABLE_PYTHON_WRAPPING AND CTK_BUILD_EXAMPLES)
+
+#-----------------------------------------------------------------------------
+# Generate target_directories list - List of directory corresponding to the different
+# libraries, plugins and applications associated with the corresponding option name.
 #
 # The following FOREACH loops are used to:
-#   1) Add build options associated with either libraries, plugins and applications
-#   2) Update either CTK_LIBS_SUBDIRS, CTK_PLUGINS_SUBDIRS or CTK_APPS_SUBDIRS variables
+#   1) Update either CTK_LIBS_SUBDIRS, CTK_PLUGINS_SUBDIRS or CTK_APPS_SUBDIRS variables
 #
 # For CTK libraries, if the file Libs/<DIR>/<LIBNAME>/ctk_library_options.cmake exists,
 # in addition to 'CTK_LIB_<DIR>/<LIBNAME>' option, the following ones
@@ -447,52 +574,23 @@ set(CTK_APPLICATIONS_SUBDIRS )
 #       OPT2:ON
 #       )
 
-# Build options associated with CTK libraries
-set(ctk_lib_options_list) # This list will be updated in ctkFunctionExtractOptionNameAndValue
-foreach(lib ${CTK_LIBS})
-  ctkFunctionExtractOptionNameAndValue(${lib} lib_name lib_value)
-  option(CTK_LIB_${lib_name} "Enable ${lib_name} Library." ${lib_value})
-  if(CTK_LIB_${lib_name})
-    ctkMacroAddCtkLibraryOptions(${lib_name})
-  endif()
-  list(APPEND CTK_LIBS_SUBDIRS "${lib_name}")
-endforeach()
-
-# Build options associated with CTK plugins
-foreach(plugin ${CTK_PLUGINS})
-  ctkFunctionExtractOptionNameAndValue(${plugin} plugin_name plugin_value)
-  option(CTK_PLUGIN_${plugin_name} "Build ${plugin_name} Plugin." ${plugin_value})
-  list(APPEND CTK_PLUGINS_SUBDIRS "${plugin_name}")
-endforeach()
-
-# Build options associated with CTK applications
-foreach(app ${CTK_APPLICATIONS})
-  ctkFunctionExtractOptionNameAndValue(${app} app_name app_value)
-  option(CTK_APP_${app_name} "Build ${app_name} Application." ${app_value})
-  list(APPEND CTK_APPLICATIONS_SUBDIRS "${app_name}")
-endforeach()
-
-#-----------------------------------------------------------------------------
-# Generate target_directories list - List of directory corresponding to the different
-# libraries, plugins and applications associated with the corresponding option name.
-#
-
 # Create list of directories corresponding to the enabled targets
 set(target_directories)
 
-foreach(lib ${CTK_LIBS_SUBDIRS})
-  set(option_name CTK_LIB_${lib})
-  list(APPEND target_directories "${CMAKE_CURRENT_SOURCE_DIR}/Libs/${lib}^^${option_name}")
+set(ctk_lib_options_list) # This list will be updated in ctkMacroAddCtkLibraryOptions
+foreach(lib ${CTK_LIBS})
+  if(CTK_LIB_${lib})
+    ctkMacroAddCtkLibraryOptions(${lib})
+  endif()
+  list(APPEND target_directories "${CMAKE_CURRENT_SOURCE_DIR}/Libs/${lib}^^CTK_LIB_${lib}")
 endforeach()
 
-foreach(plugin ${CTK_PLUGINS_SUBDIRS})
-  set(option_name CTK_PLUGIN_${plugin})
-  list(APPEND target_directories "${CMAKE_CURRENT_SOURCE_DIR}/Plugins/${plugin}^^${option_name}")
+foreach(plugin ${CTK_PLUGINS})
+  list(APPEND target_directories "${CMAKE_CURRENT_SOURCE_DIR}/Plugins/${plugin}^^CTK_PLUGIN_${plugin}")
 endforeach()
 
-foreach(app ${CTK_APPLICATIONS_SUBDIRS})
-  set(option_name CTK_APP_${app})
-  list(APPEND target_directories "${CMAKE_CURRENT_SOURCE_DIR}/Applications/${app}^^${option_name}")
+foreach(app ${CTK_APPS})
+  list(APPEND target_directories "${CMAKE_CURRENT_SOURCE_DIR}/Applications/${app}^^CTK_APP_${app}")
 endforeach()
 
 #message(STATUS target_directories:${target_directories})
@@ -706,7 +804,7 @@ endif()
 #-----------------------------------------------------------------------------
 # Add CTK library subdirectories
 #
-foreach(lib ${CTK_LIBS_SUBDIRS})
+foreach(lib ${CTK_LIBS})
   IF (CTK_LIB_${lib})
     add_subdirectory(Libs/${lib})
   endif()
@@ -715,7 +813,7 @@ endforeach()
 #-----------------------------------------------------------------------------
 # Add CTK plugin subdirectories
 #
-foreach(plugin ${CTK_PLUGINS_SUBDIRS})
+foreach(plugin ${CTK_PLUGINS})
   if(CTK_PLUGIN_${plugin})
     add_subdirectory(Plugins/${plugin})
   endif()
@@ -724,7 +822,7 @@ endforeach()
 #-----------------------------------------------------------------------------
 # Add CTK application subdirectories
 #
-foreach(app ${CTK_APPLICATIONS_SUBDIRS})
+foreach(app ${CTK_APPS})
   IF (CTK_APP_${app})
     add_subdirectory(Applications/${app})
   endif()

+ 1 - 1
Libs/DICOM/Core/CMakeLists.txt

@@ -87,7 +87,7 @@ if(CTK_WRAP_PYTHONQT_FULL OR CTK_WRAP_PYTHONQT_LIGHT)
 endif()
 
 # Plugins
-#if(BUILD_QTDESIGNER_PLUGINS)
+#if(CTK_BUILD_QTDESIGNER_PLUGINS)
 #  add_subdirectory(Plugins)
 #endif()
 

+ 1 - 1
Libs/DICOM/Widgets/CMakeLists.txt

@@ -88,7 +88,7 @@ if(CTK_WRAP_PYTHONQT_FULL OR CTK_WRAP_PYTHONQT_LIGHT)
 endif()
 
 # Plugins
-if(BUILD_QTDESIGNER_PLUGINS)
+if(CTK_BUILD_QTDESIGNER_PLUGINS)
   add_subdirectory(Plugins)
 endif()
 

+ 1 - 1
Libs/ImageProcessing/ITK/Core/CMakeLists.txt

@@ -54,7 +54,7 @@ if(CTK_WRAP_PYTHONQT_FULL OR CTK_WRAP_PYTHONQT_LIGHT)
 endif()
 
 # Plugins
-#if(BUILD_QTDESIGNER_PLUGINS)
+#if(CTK_BUILD_QTDESIGNER_PLUGINS)
 #  add_subdirectory(Plugins)
 #endif()
 

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

@@ -67,7 +67,7 @@ ctkMacroBuildLib(
   )
 
 # Plugins
-#if(BUILD_QTDESIGNER_PLUGINS)
+#if(CTK_BUILD_QTDESIGNER_PLUGINS)
 #  add_subdirectory(Plugins)
 #endif()
 

+ 1 - 1
Libs/Scripting/Python/Widgets/CMakeLists.txt

@@ -57,7 +57,7 @@ if(CTK_WRAP_PYTHONQT_FULL OR CTK_WRAP_PYTHONQT_LIGHT)
 endif()
 
 # Plugins
-if(BUILD_QTDESIGNER_PLUGINS)
+if(CTK_BUILD_QTDESIGNER_PLUGINS)
   add_subdirectory(Plugins)
 endif()
 

+ 1 - 1
Libs/Visualization/VTK/Core/CMakeLists.txt

@@ -93,7 +93,7 @@ if(CTK_WRAP_PYTHONQT_FULL OR CTK_WRAP_PYTHONQT_LIGHT)
 endif()
 
 # Plugins
-#if(BUILD_QTDESIGNER_PLUGINS)
+#if(CTK_BUILD_QTDESIGNER_PLUGINS)
 #  add_subdirectory(Plugins)
 #endif()
 

+ 1 - 1
Libs/Visualization/VTK/Widgets/CMakeLists.txt

@@ -139,7 +139,7 @@ if(CTK_WRAP_PYTHONQT_FULL OR CTK_WRAP_PYTHONQT_LIGHT)
 endif()
 
 # Plugins
-if(BUILD_QTDESIGNER_PLUGINS)
+if(CTK_BUILD_QTDESIGNER_PLUGINS)
   add_subdirectory(Plugins)
 endif()
 

+ 1 - 1
Libs/Visualization/XIP/CMakeLists.txt

@@ -50,7 +50,7 @@ if(CTK_WRAP_PYTHONQT_FULL OR CTK_WRAP_PYTHONQT_LIGHT)
 endif()
 
 # Plugins
-#if(BUILD_QTDESIGNER_PLUGINS)
+#if(CTK_BUILD_QTDESIGNER_PLUGINS)
 #  add_subdirectory(Plugins)
 #endif()
 

+ 1 - 1
Libs/Widgets/CMakeLists.txt

@@ -290,7 +290,7 @@ if(CTK_WRAP_PYTHONQT_FULL OR CTK_WRAP_PYTHONQT_LIGHT)
 endif()
 
 # Plugins
-if(BUILD_QTDESIGNER_PLUGINS)
+if(CTK_BUILD_QTDESIGNER_PLUGINS)
   add_subdirectory(Plugins)
 endif()
 

+ 4 - 4
SuperBuild.cmake

@@ -52,17 +52,17 @@ find_package(Doxygen QUIET)
 # Generate cmake variable name corresponding to Libs, Plugins and Applications
 #
 set(ctk_libs_bool_vars)
-foreach(lib ${CTK_LIBS_SUBDIRS})
+foreach(lib ${CTK_LIBS})
   list(APPEND ctk_libs_bool_vars CTK_LIB_${lib})
 endforeach()
 
 set(ctk_plugins_bool_vars)
-foreach(plugin ${CTK_PLUGINS_SUBDIRS})
+foreach(plugin ${CTK_PLUGINS})
   list(APPEND ctk_plugins_bool_vars CTK_PLUGIN_${plugin})
 endforeach()
 
 set(ctk_applications_bool_vars)
-foreach(app ${CTK_APPLICATIONS_SUBDIRS})
+foreach(app ${CTK_APPS})
   list(APPEND ctk_applications_bool_vars CTK_APP_${app})
 endforeach()
 
@@ -72,7 +72,7 @@ endforeach()
 
 set(ctk_cmake_boolean_args
   BUILD_TESTING
-  BUILD_QTDESIGNER_PLUGINS
+  CTK_BUILD_QTDESIGNER_PLUGINS
   CTK_USE_KWSTYLE
   WITH_COVERAGE
   DOCUMENTATION_TARGET_IN_ALL