<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 22, 2019 at 10:27 AM Michael Jackson <<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Do this all the time both for our CDash nightlies and when I am developing on Windows. The essential pieces of the puzzle are the following:<br>
<br>
1: Ninja needs to be on your path<br>
2: The compilers need to be on your path.<br>
<br>
1 can be solved in a few different ways. The brute force is to edit the system path variable and place the folder containing Ninja into the system path. I do NOT recommend doing this. Repeat. DON'T DO IT. You can edit your "User" PATH environment variable and add to the PATH. This is the more recommended way but a bit tedious to get into that dialog box to adjust. We will come back to this..<br>
<br>
For 2, use the "Visual Studio Command Prompt" which has all the paths to the compilers setup for you. Now the question becomes, how to combine 1 and 2. My own solution (which is far from optimal, but works) is that I setup my own "short cut" to a command prompt that launches my own custom .bat file that sits on my desktop. In that .bat file is basically a copy of the vcvarsall.bat file and then I add to that my own specific PATH values for things like Qt, hdf5, cmake, ninja that on located on my system. I keep both the shortcut and the .bat file on my desktop so all I need to do is double click to get a correctly configured command prompt for my dev environment. If a version of something changes I just edit the .bat file and I am ready to go. You can then also do "cmake-gui.exe ." from inside a build folder to have CMake-Gui launch with all the correctly identified compilers. <br></blockquote><div><br></div><div>For this option, you can use the batch command, "call", to read in the environment of another ".bat" script, so that you do not have to make copies of the vcvarsall.bat files.  As long as you are not using "setlocal" in a script, then the environment variables will propagate up to the caller.</div><div><br></div><div> For example your script can have (for VS 2015) :</div><div><span style="color:rgb(0,0,0);font-family:"Segoe UI","Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px">call "%VS140COMNTOOLS%VsVars32.bat"</span>  <br></div><div><br></div><div>and the add lines setting additional PATH values.</div><div><br></div><div>Regards,</div><div><br></div><div>Juan</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I am happy to share the .bat file if you are interested. I have it updated for VS2017 at the moment but have been doing it this way since VS2013.<br>
<br>
--<br>
Michael Jackson | Owner, President<br>
      BlueQuartz Software<br>
[e] <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
[w] <a href="http://www.bluequartz.net" rel="noreferrer" target="_blank">www.bluequartz.net</a> <<a href="http://www.bluequartz.net" rel="noreferrer" target="_blank">http://www.bluequartz.net</a>><br>
<br>
On 5/22/19, 9:58 AM, "CMake on behalf of Robert Dailey" <<a href="mailto:cmake-bounces@cmake.org" target="_blank">cmake-bounces@cmake.org</a> on behalf of <a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>> wrote:<br>
<br>
    From the command line, I want to generate Ninja build scripts that<br>
    utilize a specific version of MSVC compiler. Basically I'd like the<br>
    combination of `-G"Visual Studio 15 2017"` with regards to its ability<br>
    to find the C and C++ compiler on the system via registry/environment<br>
    variables, and `-G"Ninja"` with regards to it being the build driver<br>
    for that compiler.<br>
<br>
    Is this even possible?<br>
    -- <br>
<br>
<br>
<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div></div>