On 09/10/2014 05:33 PM, Brad King wrote:
Thanks.  I've updated the topic to include all the actual fixes
for CMP0054 warnings within CMake's own code that I've found so
far.

Thanks!

I have a few more changes to request that you add to the topic:

* The wording of the warning says what the change in behavior
   is, but does not inform the user that the old behavior is
   being used for compatibility.  Currently without reading the
   policy documentation one might think from the messages that
   the logic is being executed differently than before.

Done.

* In cmIfCommand we should avoid doing the lookups when the
   policy is NEW.  Instead of calling mf->GetPolicyStatus on
   every step of the way, call it once at the beginning of the
   if() command execution and save the result in a member.
   Then in cmIfCommand::GetDefinitionIfUnquoted, check for
   quoting and the policy status before even trying to do the
   lookup.  That should make processing of quoted arguments
   much faster because we won't have to check for a definition
   with every string value.

The functions for condition evaluation were global or static (I assume so they could be shared with while()) and I would have had to pass through the policy state as extra parameters. This was also done with CMP0012 but I figured I might just as well extract everything into its own class "cmConditionEvaluator" and have it keep everything that was being passed around as members instead.

* The CMP0054-keywords-NEW test does not cover "(" and ")".
   (Good catch on implementing those, BTW.)

* The tests need to cover if() inside while() and foreach()
   as well as macro() and function().  Also add nested if()
   for completeness.

I added tests but specifically for the loops I am not entirely sure what to cover given that the context of recording and replaying is basically the same (unlike with functions/macros)? I wouldn't mind some extra scrutiny to make sure they cover what you had in mind.

Thanks.

Nils
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to