Re: [CMake] comparing strings

2013-02-18 Thread Shaun Williams
, 2013 at 12:13 PM, Alexander Neundorf a.neundorf-w...@gmx.net wrote: On Thursday 14 February 2013, Shaun Williams wrote: I'm slowly realizing the gravity of this behavior: if(build_system STREQUAL windows) ... endif() If someone creates a variable named windows, then this code

[CMake] comparing strings

2013-02-14 Thread Shaun Williams
Hi, I learned something very valuable today about cmake after getting an unexpected result with STREQUAL: set(foo bar) ... set(baz foo) ... if(${baz} STREQUAL bar) # This evaluates to true. ... I expected it to be false, because I was trying to get baz's value (foo) to compare with bar. I

Re: [CMake] comparing strings

2013-02-14 Thread Shaun Williams
${build_system} windows _cmp) if (_cmp) ... endif() It will make it ugly to create a nested if else block, but it'll work. On Thu, Feb 14, 2013 at 4:20 PM, Matthew Woehlke matthew.woeh...@kitware.com wrote: On 2013-02-14 16:44, Shaun Williams wrote: I learned something very valuable today about