[Insight-developers] ITK_BUILD_ALL_MODULES and ITK_BUILD_DEFAULT_MODULES
Padfield, Dirk R (GE Global Research)
padfield at research.ge.com
Fri Oct 4 13:25:15 EDT 2013
Hi Developers,
I have a quick ITK CMake question. In the file CMake/ITKModuleEnablement.cmake, we find the code
# To maintain backward compatibility
if(DEFINED ITK_BUILD_ALL_MODULES)
message(WARNING "ITK_BUILD_ALL_MODULES is deprecated, please use ITK_BUILD_DEFAULT_MODULES.")
set(ITK_BUILD_DEFAULT_MODULES ${ITK_BUILD_ALL_MODULES} CACHE BOOL "Build the default ITK modules." FORCE)
endif()
This has the following behavior:
1) If ITK_BUILD_ALL_MODULES is set, ITK_BUILD_DEFAULT_MODULES is also set.
2) When the user sees this warning, he/she may turn off ITK_BUILD_MODULES.
3) This also turns off the ITK_BUILD_DEFAULT_MODULES
4) Since ITK_BUILD_ALL_MODULES is still DEFINED, the warning continues.
5) If the user explicitly turns ITK_BUILD_DEFAULT_MODULES back on, it gets turned off again on the next compile
6) The only way to get the expected behavior is to keep both of them on, but then the warning continues.
I believe the intention was instead to use
if(${ITK_BUILD_ALL_MODULES})
In this case
1) If ITK_BUILD_ALL_MODULES is set, it gives a warning and then sets ITK_BUILD_DEFAULT_MODULES
2) The warning is only given when ITK_BUILD_ALL_MODULES is turned on
3) If ITK_BUILD_ALL_MODULES is turned off, it has no effect on ITK_BUILD_DEFAULT_MODULES
4) ITK_BUILD_DEFAULT_MODULES can be set when ITK_BUILD_ALL_MODULES is turned off
Thoughts?
Thanks,
Dirk
More information about the Insight-developers
mailing list