<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 20, 2016 at 5:54 PM, Brad King <span dir="ltr"><<a href="mailto:brad.king@kitware.com" target="_blank">brad.king@kitware.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 class="">On 04/20/2016 10:01 AM, Johan Holmberg wrote:<br>
> I tried specifying "-GNinja" to cmake, and setting CC/CXX to<br>
> clang/clang++.<br>
<br>
</span>Good.<br>
<span class=""><br>
> But this didn't work. I get errors like:<br>
><br>
>   clang.exe: error: no such file or directory: '/nologo'<br>
><br>
> indicating that CMake thinks it should pass Visual C++ style<br>
> options to clang.<br>
<br>
</span>There are multiple variants of Clang that behave like "gcc" or "cl".<br>
Which one is this?  What installer did you use for Clang?<br></blockquote><div><br><br></div><div>I used the installer at <a href="http://llvm.org/releases/3.8.0/LLVM-3.8.0-win64.exe">http://llvm.org/releases/3.8.0/LLVM-3.8.0-win64.exe</a> .<br></div><div><br>I chose the binaries behaving like "gcc": After installation I added the "bin" directory to my PATH (actual command "set path=e:\work\install\LLVM\bin;%PATH%"). In the new bin-directory there are binaries called "clang.exe" and "clang++.exe" + a bunch of other binaries eg. "clang-cl.exe". I did NOT put the directory "e:\work\install\LLVM\msbuild-bin" in my PATH (containing a binary "cl.exe").<br></div><div><br></div><div>I realize that Cristian Adams recommended using the "cl.exe" wrapper in his response, but I wanted at least to try using the "gcc-like" binaries first, hoping that they should work with CMake. I will probably try his advice later, but as I understand it, both ways should be possible to get working with CMake.<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
CMake should start out by printing the compiler id for the C and<br>
CXX compilers.  What did it show?<br>
<br></blockquote><div><br></div><div>CMake starts by saying:<br><br>E:\work\proj\hello1\build> cmake -GNinja ..\src<br>-- The C compiler identification is Clang 3.8.0<br>-- The CXX compiler identification is Clang 3.8.0<br>-- Check for working C compiler using: Ninja<br>-- Check for working C compiler using: Ninja -- broken<br></div><div>[...rest removed...]<br></div><div> <br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Please try a minimum test project like<br>
<br>
    >type CMakeLists.txt<br>
    cmake_minimum_required(VERSION 3.5)<br>
    project(Test)<br>
<br>
in a fresh build tree and post the files<br>
<br>
    CMakeFiles/CMake*.log<br>
    CMakeFiles/*/CMake*Compiler.cmake<br>
<br>
to see what CMake detected about the compiler.<br>
Thanks,<br>
-Brad<br>
<br></blockquote><div><br><br></div><div>OK, I attach the files to this mail. There were three file created:<br><br>    build/CMakeFiles/3.5.1/CMakeRCCompiler.cmake<br>    build/CMakeFiles/CMakeError.log<br>    build/CMakeFiles/CMakeOutput.log<br><br></div><div>On my Windows machine I have Visual Studio 2008, 2012, 2013 and 2015. I used CMake 3.5.1 and Ninja 1.6.0.<br></div><div><br></div><div>/Johan Holmberg<br> <br></div></div><br></div></div>