<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi all,<div><br></div><div>Please help me an issue I'm facing with CMAKE_HOST_SYSTEM_NAME on FreeBSD 10.3. It gives back empty string, if I read it before the 'project(...)'.</div><div>As far as I understood, CMAKE_SYSTEM_NAME can be used only after the 'project(...)' call, but CMAKE_HOST_SYSTEM_NAME should simply give back the result of 'uname -s' and could be used before 'project'.<br></div><div>I'd like to use CMAKE_HOST_SYSTEM_NAME in my Compilers module to switch to clang instead of gcc in case if the host system is FreeBSD.</div><div><br></div><div>CMakeLists.txt:</div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><div><span style="color:rgb(0,0,255);font-family:monospace,monospace">...</span><br></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">include(Version)</font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">include(BuildType)</font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">include(Compilers)</font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#ff0000"><b>message ( "!Before project='${CMAKE_HOST_SYSTEM_NAME}'" )</b></font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff"><b>project ( WanderfulProject LANGUAGES C )</b></font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff"><b>message ( "!After project='${CMAKE_HOST_SYSTEM_NAME}'" )</b></font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">include(Endianness)</font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">include(GNUInstallDirs)</font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">include(Configure)</font></div></div></div></div><div><span style="color:rgb(0,0,255);font-family:monospace,monospace">...</span><br></div></blockquote><div dir="ltr"><div dir="ltr"><div><br></div><div>Output:</div></div></div></div></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font color="#0000ff" face="monospace, monospace">...</font></div></div></div></div></div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><div><b><font face="monospace, monospace" color="#ff0000">!Before project=''</font></b></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">-- The C compiler identification is GNU 4.8.5</font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">-- Check for working C compiler: /usr/bin/gcc</font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">-- Check for working C compiler: /usr/bin/gcc -- works</font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">-- Detecting C compiler ABI info</font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">-- Detecting C compiler ABI info - done</font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">-- Detecting C compile features</font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff">-- Detecting C compile features - done</font></div></div></div></div><div><div><div><div><b><font face="monospace, monospace" color="#0000ff">!After project='FreeBSD'</font></b></div></div></div></div><div><b><font face="monospace, monospace" color="#0000ff">...</font></b></div><div><br></div></blockquote><div><font color="#000000" face="arial, helvetica, sans-serif"><div>Additional info:</div></font></div></div></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><div><div><div><font face="monospace, monospace" color="#0000ff"><div><div>$ cmake --version</div></div></font></div></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff"><div><div>cmake version 3.4.1</div></div></font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff"><div><div>$ uname -K</div></div></font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff"><div><div>1003000</div></div></font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff"><div><div>$ uname -s</div></div></font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff"><div><div>FreeBSD</div></div></font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff"><div><div>$ uname -m</div></div></font></div></div></div></div><div><div><div><div><font face="monospace, monospace" color="#0000ff"><div><div>amd64</div></div></font></div></div></div></div></blockquote></div>
</div></div>