[cmake-developers] FindGTest.cmake and CMP0064

Rolf Eike Beer eike at sf-mail.de
Tue Nov 17 11:37:30 EST 2015


Am 17.11.2015 17:08, schrieb David Chen:
> We’ve been getting a warning from FindGTest.cmake about CMP0064 when
> building SimpleITK.  The warning occurs at lines 127, 129 and 131 when
> the variable ${test_type} is equal to “TEST”.  With CMP0064 this TEST
> could be interpreted as commands in the if() and elseif() statements
> unless the policy is set to OLD.
> 
> I’ve attached a patch for your consideration that re-writes those
> statements.  I have changed the STREQUAL comparisons to regex MATCHES
> comparisons.  This change removes the possibility of “TEST” being the
> first word inside the parentheses.

The correct fix would probably to just remove the dereference, i.e. 
change

   if(${test_type} STREQUAL "TEST_P")

to

   if(test_type STREQUAL "TEST_P")

Greetings,

Eike


More information about the cmake-developers mailing list