<div dir="ltr">Isn't it better to use vsvars32.bat? (or vsvars64.bat? - don't have a 64 bit windows)<div><br></div><div>Here is the batch script for VS 2013, 2012, 2010 (priority in this specific order)</div><div><br>
</div><div>~~~~~~~~~</div><div><pre style="font-family:'Bitstream Vera Sans Mono','DejaVu Sans Mono',Monaco,monospace;font-size:12px;line-height:1.4000000000000001;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(51,51,51)">
<span style="color:rgb(0,64,128)">IF</span> <span style="color:rgb(0,64,128)">EXIST</span> <span style="color:rgb(187,136,68)">"%VS120COMNTOOLS%"</span> <span style="color:rgb(0,64,128)">CALL</span> <span style="color:rgb(187,136,68)">"%VS120COMNTOOLS%vsvars32.bat"</span> && <span style="color:rgb(0,64,128)">SET</span> <span style="color:rgb(0,128,128)">GENERATOR</span><span>=</span><span style="color:rgb(187,136,68)">"Visual Studio 12"</span> && <span style="color:rgb(0,64,128)">GOTO</span> <span>BUILD</span>
<a name="145e7d396abd26f4_cl-23" style="color:rgb(59,115,175)"></a><span style="color:rgb(0,64,128)">IF</span> <span style="color:rgb(0,64,128)">EXIST</span> <span style="color:rgb(187,136,68)">"%VS110COMNTOOLS%"</span> <span style="color:rgb(0,64,128)">CALL</span> <span style="color:rgb(187,136,68)">"%VS110COMNTOOLS%vsvars32.bat"</span> && <span style="color:rgb(0,64,128)">SET</span> <span style="color:rgb(0,128,128)">GENERATOR</span><span>=</span><span style="color:rgb(187,136,68)">"Visual Studio 11"</span> && <span style="color:rgb(0,64,128)">GOTO</span> <span>BUILD</span>
<a name="145e7d396abd26f4_cl-24" style="color:rgb(59,115,175)"></a><span style="color:rgb(0,64,128)">IF</span> <span style="color:rgb(0,64,128)">EXIST</span> <span style="color:rgb(187,136,68)">"%VS100COMNTOOLS%"</span> <span style="color:rgb(0,64,128)">CALL</span> <span style="color:rgb(187,136,68)">"%VS100COMNTOOLS%vsvars32.bat"</span> && <span style="color:rgb(0,64,128)">SET</span> <span style="color:rgb(0,128,128)">GENERATOR</span><span>=</span><span style="color:rgb(187,136,68)">"Visual Studio 10"</span> && <span style="color:rgb(0,64,128)">GOTO</span> <span>BUILD</span>
</pre></div><div><span><br></span></div><div>:BUILD</div><div><br></div><div>cmake -G %GENERATOR% ....</div><div>msbuild ....</div><div>~~~~~~~~~~~</div><div><br></div><div>Here is the source for the script: <a href="https://bitbucket.org/undergraver/codetrainer/src/b606752e18f10fefd6b84eb22ac3b7c1e674e729/scripts/windows/build.bat?at=default">https://bitbucket.org/undergraver/codetrainer/src/b606752e18f10fefd6b84eb22ac3b7c1e674e729/scripts/windows/build.bat?at=default</a></div>
<div><br></div><div>Best regards,</div><div>Iulian</div><div><span><br>
</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 9, 2014 at 12:09 AM, David Cole <span dir="ltr"><<a href="mailto:dlrdave@aol.com" target="_blank">dlrdave@aol.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How about:<br>
<br>
if(EXISTS "$ENV{VS110COMNTOOLS}../../VC"<u></u>)<br>
get_filename_component(VC11_<u></u>DIR "$ENV{VS110COMNTOOLS}../../VC" ABSOLUTE)<br>
endif()<br>
if(EXISTS "$ENV{VS120COMNTOOLS}../../VC"<u></u>)<br>
get_filename_component(VC12_<u></u>DIR "$ENV{VS120COMNTOOLS}../../VC" ABSOLUTE)<br>
endif()<br>
message(STATUS "VC11_DIR='${VC11_DIR}'")<br>
message(STATUS "VC12_DIR='${VC12_DIR}'")<br>
<br>
<br>
HTH,<br>
David C.<div class="HOEnZb"><div class="h5"><br>
<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/<u></u>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/<u></u>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/<u></u>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/<u></u>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/<u></u>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/<u></u>listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>