<div dir="ltr"><div><div><div>`if(${LINUX64})` will expand to `if()` if LINUX64 is either not defined, or holds an empty string. In both cases, it's a syntax error. If you want to check whether LINUX64 is set to a truthy value, either quote it, or don't dereference it:<br><br></div>if((CMAKE_SYSTEM_NAME MATCHES "SunOS") OR LINUX64)<br><br></div>Note that you don't have to dereference the left-hand argument of MATCHES either. In fact, it's safer to either not dereference it, or put quotes around the dereference.<br><br></div>Petr<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 15, 2015 at 8:07 PM, Tom Kacvinsky <span dir="ltr"><<a href="mailto:tom.kacvinsky@vectorcast.com" target="_blank">tom.kacvinsky@vectorcast.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, May 15, 2015 at 1:05 PM, Tom Kacvinsky <span dir="ltr"><<a href="mailto:tom.kacvinsky@vectorcast.com" target="_blank">tom.kacvinsky@vectorcast.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div class="gmail_extra"><div class="gmail_quote">On Fri, May 15, 2015 at 12:12 PM, Domen Vrankar <span dir="ltr"><<a href="mailto:domen.vrankar@gmail.com" target="_blank">domen.vrankar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>> if ((${CMAKE_SYSTEM_NAME} MATCHES "SunOS") or (DEFINED LINUX64))<br>
>   message(STATUS "On Solaris or 64 bit Linux")<br>
> endif()<br>
> # ====================================================[<br>
><br>
> I'm using cmake version 2.8.11.2 built from source on<br>
><br>
> Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Thu Mar 15 19:46:53 EDT 2007<br>
> x86_64 x86_64 x86_64 GNU/Linux<br>
><br>
> This doesn't work.  I get this error message is:<br>
><br>
> CMake Error at CMakeLists.txt:12 (if):<br>
>   if given arguments:<br>
><br>
>     "(" "Linux" "MATCHES" "SunOS" ")" "or" "(" "DEFINED" "LINUX64" ")"<br>
><br>
>   Unknown arguments specified<br>
><br>
><br>
> What am I doing wrong?  Is this syntax not supported until the 3.x series?<br>
<br>
</span>Commands are case sensitive so OR should be upper cased.<br>
Also I would recommand you either use "${var_name}" or var_name as the<br>
command expects either a string or a variable.<br>
<br>
Regards,<br>
Domen<br>
</blockquote></div><br></div></div></div><div class="gmail_extra">Ah, that did it.  Changing to uppercase OR fixed the issue.  Many thanks.<br><br></div></div></blockquote><div><br></div></div></div><div>Well, shoot.  I had made a typeo that fooled cmake into thinking what I had done is OK.  Here is what I have now:<br><br> if ((${CMAKE_SYSTEM_NAME} MATCHES "SunOS") OR ${LINUX64})<br></div></div><br></div><div class="gmail_extra">and I still get a complaint:<br><br>CMake Error at CMakeLists.txt:164 (if):<br>  if given arguments:<br><br>    "(" "Linux" "MATCHES" "SunOS" ")" "OR"<br><br><br><br></div></div>
<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>