<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Thanks for the tip, but that hasn&#39;t been very helpful to me.  Perhaps I&#39;m not doing it right.  Here is a bit of CMake code so the conversation can be more concrete.  Perhaps someone on list can try it out...<div>
<br></div><div>You&#39;ll need these two files...</div>

<div><br></div><div><a href="http://www.fltk.org/software.php?VERSION=1.3.2&amp;FILE=fltk/1.3.2/fltk-1.3.2-source.tar.gz" target="_blank">http://www.fltk.org/software.php?VERSION=1.3.2&amp;FILE=fltk/1.3.2/fltk-1.3.2-source.tar.gz</a><br>


</div><div><a href="http://seriss.com/people/erco/fltk/tmp/vsnet-makefiles.0.85.zip" target="_blank">http://seriss.com/people/erco/fltk/tmp/vsnet-makefiles.0.85.zip</a><br></div><div><br></div><div>Place them in the same directory with the following in the CMakeLists.txt</div>

<div><br></div><div>CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )<br></div><div><br></div><div>INCLUDE( ExternalProject )</div><div><br></div><div>SET( VS_MAKEFILE_ZIP vsnet-makefiles.0.85.zip )<br></div><div>
<div><br></div><div>ExternalProject_Add( FLTK</div><div><span style="white-space:pre-wrap">        </span>URL ${CMAKE_SOURCE_DIR}/fltk-1.3.2-source.tar</div><div><span style="white-space:pre-wrap">        </span>UPDATE_COMMAND</div>
<div><span style="white-space:pre-wrap">                </span>${CMAKE_COMMAND} -E copy_if_different</div><div><span style="white-space:pre-wrap">                </span>${CMAKE_SOURCE_DIR}/${VS_MAKEFILE_ZIP}</div><div><span style="white-space:pre-wrap">                </span>&lt;SOURCE_DIR&gt;/${VS_MAKEFILE_ZIP}</div>


<div><span style="white-space:pre-wrap">        </span>COMMAND</div><div><span style="white-space:pre-wrap">                </span>${CMAKE_COMMAND} -E tar -xzf &lt;SOURCE_DIR&gt;/${VS_MAKEFILE_ZIP}</div><div><span style="white-space:pre-wrap">        </span><br>


</div><div><span style="white-space:pre-wrap">        </span>PATCH_COMMAND &quot;&quot;</div><div><span style="white-space:pre-wrap">        </span>CONFIGURE_COMMAND &quot;&quot;</div><div><span style="white-space:pre-wrap">        </span>BUILD_COMMAND &quot;&quot;</div>


<div><span style="white-space:pre-wrap">        </span>INSTALL_COMMAND &quot;&quot;</div><div>)<br></div></div><div><br></div><div><br></div><div>To build this manually, first, unzip both files into the same directory.  Then, launch the Visual Studio Command Prompt, usually accessed via the VS/<span style="color:rgb(80,0,80)">vcvarsall.bat program included with Visual Studio.</span></div>


<div><span style="color:rgb(80,0,80)"><br></span></div><div>Once both files are unzipped into the same directory, and you are in the VS prompt environment, you can build FLTK using the batch program &#39;gmake.bat&#39;.</div>


<div><br></div><div>For better or worse, it prompts the user to input for Debug or Release, and then for Verbose or Quiet.  If you make a simple text file with the entries one per line...</div><div><br></div><div>******* input.txt</div>


<div>R</div><div>Q</div><div>*******</div><div><br></div><div>You can feed that to the batch program thusly....</div><div><br></div><div>gmake &lt; input.txt</div><div><br></div><div>Alternately, if you can set DEBUG=R and VERBOSE=Q environment variables to the shell used to run &#39;gmake.bat&#39;, then you don&#39;t have to feed the text file for the user-input prompts.</div>


<div><br></div><div>I tried something like the following....</div><div><br></div><div>BUILD_COMMAND<br></div><div><div>   ${CMAKE_COMMAND} --build &lt;SOURCE_DIR&gt; -- gmake<br></div></div><div><br></div><div>But, it didn&#39;t seem to do anything useful....</div>
<span class="HOEnZb"><font color="#888888">

<div><br></div><div>Rob</div></font></span><div><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 8, 2014 at 5:31 PM, J Decker <span dir="ltr">&lt;<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">cmake --build<br>
<div><div><br>
On Wed, Jan 8, 2014 at 3:53 PM, Rob McDonald &lt;<a href="mailto:rob.a.mcdonald@gmail.com" target="_blank">rob.a.mcdonald@gmail.com</a>&gt; wrote:<br>
&gt; Short version:<br>
&gt;<br>
&gt; Does anyone have an elegant way to launch the visual studio command line<br>
&gt; from within CMake?<br>
&gt;<br>
&gt; James Bigler asked essentially this question back in March of 2011.  David<br>
&gt; responded with a link to a Blog entry, but I haven&#39;t figured out how to<br>
&gt; translate that into something that works.<br>
&gt;<br>
&gt; The &#39;vcvarsall.bat&#39; program that comes with Visual Studio will launch the<br>
&gt; command line with the full environment set.<br>
&gt;<br>
&gt; Once I find vcvarsall, I then need to launch something in it -- and pass<br>
&gt; parameters to that thing.  All from within ExternalProject_Add.  For now,<br>
&gt; one step at a time...<br>
&gt;<br>
&gt; Long version:<br>
&gt;<br>
&gt; I&#39;m trying to encapsulate the build of FLTK as an ExternalProject in CMake.<br>
&gt; One way or the other, it needs to work for Visual Studio on Windows, and gcc<br>
&gt; and llvm on Linux/MacOS.<br>
&gt;<br>
&gt; Although FLTK has a CMake build system, it is currently unmaintained (broken<br>
&gt; on at least some platforms), and none of the core FLTK developers use it, so<br>
&gt; I don&#39;t see this situation improving.<br>
&gt;<br>
&gt; I&#39;ve got a ./configure based system working for Linux/MacOS.<br>
&gt;<br>
&gt; One of the FLTK developers maintains an unofficial Makefile setup for<br>
&gt; FLKT/Visual Studio that must be run from the Visual Studio command prompt.<br>
&gt; Hence my question...<br>
&gt;<br>
&gt; <a href="http://seriss.com/people/erco/fltk/tmp/vsnet-makefiles.0.85.zip" target="_blank">http://seriss.com/people/erco/fltk/tmp/vsnet-makefiles.0.85.zip</a><br>
&gt;<br>
&gt; Thanks for any help,<br>
&gt;<br>
&gt; Rob<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; --<br>
&gt;<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;<br>
&gt; Kitware offers various services to support the CMake community. For more<br>
&gt; information on each offering, please visit:<br>
&gt;<br>
&gt; CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
&gt; CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
&gt; CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div></div></div></div>
</div><br></div>