[Insight-developers] ITK_BUILD_ALL_MODULES and ITK_BUILD_DEFAULT_MODULES

Xiaoxiao Liu xiaoxiao.liu at kitware.com
Thu Oct 10 10:16:44 EDT 2013


sorry, a typo is corrected below:

On Thu, Oct 10, 2013 at 10:14 AM, Xiaoxiao Liu <xiaoxiao.liu at kitware.com>wrote:

> Hi Dirk,
>
> If we change from
> if(DEFINED ITK_BUILD_ALL_MODULES)
> to
> if(${ITK_BUILD_ALL_MODULES}), as you suggested,
>
> and allow users to turn ${ITK_BUILD_ALL_MODULES} OFF while keep
> ${ITK_BUILD_DEFAULT_MODULES} being OFF.  It might be confusing
>
*>>>

        this should be ^^^^ ON*

> as well, because suddenly you have both CMake variables in your CMake
> Cache for the same purpose but with contradicting values.
>
> The purpose of the warning is to inform people that they should not use ITK_BUILD_ALL_MODULES
> any more.  So here is a patch to prompt with clearer message to remove it
> from the CMake Cache:
>
> http://review.source.kitware.com/#/c/12975/
>
> Please let me know whether it make sense.
> Thanks!
>
>
> -Xiaoxiao
>
>
>
>
>
> On Mon, Oct 7, 2013 at 10:20 AM, Padfield, Dirk R (GE Global Research) <
> padfield at research.ge.com> wrote:
>
>> Hi Xiaoxiao,
>>
>> Thanks for the explanation.  I imagine that many users will have existing
>> trees and will be thrown off by the behavior listed below.  Would there be
>> any negative consequences to changing
>>
>> from
>> if(DEFINED ITK_BUILD_ALL_MODULES)
>> to
>> if(${ITK_BUILD_ALL_MODULES})
>>
>> The latter seems more intuitive to me and also seems to behave better
>> (according to the behavior I listed below).  It doesn't matter much to me
>> either way, but I thought it might matter to users.
>>
>> Thanks,
>> Dirk
>>
>>
>> ________________________________
>> From: Xiaoxiao Liu [xiaoxiao.liu at kitware.com]
>> Sent: Friday, October 04, 2013 2:30 PM
>> To: Padfield, Dirk R (GE Global Research)
>> Cc: <insight-developers at itk.org> Developers
>> Subject: Re: [Insight-developers] ITK_BUILD_ALL_MODULES and
>> ITK_BUILD_DEFAULT_MODULES
>>
>> Dirk,
>> Thanks for reporting.
>> Please see my comments below.
>> Let me know whether this clarifies.
>> Thanks.
>>
>> On Fri, Oct 4, 2013 at 1:25 PM, Padfield, Dirk R (GE Global Research) <
>> padfield at research.ge.com<mailto:padfield at research.ge.com>> wrote:
>> 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.
>> >>> If you start from an existing build tree (which has the old cache
>> entry of "ITK_BUILD_ALL_Modules"), yes, you would
>> see this warning. To remove this warning (without cleaninig the entire
>> CMake Cache),  instead of turning OFF "ITK_BUILD_ALL_Modules",  you could
>> just remove it from the CMake cache (on CMake GUI, select the variable and
>> hit "Delete").
>>
>> 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
>> _______________________________________________
>> Powered by www.kitware.com<http://www.kitware.com>
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-developers
>>
>>
>>
>> --
>>
>>
>> ---------------------------------------------
>> Xiaoxiao Liu, Ph.D.
>> R & D Engineer
>> Kitware Inc<http://www.kitware.com/>.
>> Clifton Park, NY
>> Phone: (518) 881-4924  or  (518) 371-3971 x124
>>
>>
>
>
> --
>
>
> ---------------------------------------------
> *Xiaoxiao Liu*, Ph.D.
> R & D Engineer
> Kitware Inc <http://www.kitware.com/>.
> Clifton Park, NY
> Phone: (518) 881-4924  or  (518) 371-3971 x124
>
>


-- 


---------------------------------------------
*Xiaoxiao Liu*, Ph.D.
R & D Engineer
Kitware Inc <http://www.kitware.com/>.
Clifton Park, NY
Phone: (518) 881-4924  or  (518) 371-3971 x124
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20131010/569725e0/attachment.htm>


More information about the Insight-developers mailing list