<div dir="ltr">Very sorry for not replying to the list, I certainly meant to.  I didn&#39;t mean to impose my problem on you -- and I was hoping that by flushing my example out more fully, more people may be able to help out.  I will go back and forward that response/question so people don&#39;t have to dig it out of this chain.<br>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 8, 2014 at 8:49 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">
(you should have replied that back to the list....)<br>
My uppermost project is a project chain of independant source parts in<br>
my tree... the topmost project writes out makeit.bat configuration<br>
files with a &quot;cmake ...&quot; command that has all the required options and<br>
switches (I&#39;ll append at end) and then the appropriate build command<br>
for the cmake environment...<br>
<br>
but then from the commandline I just do cmake --build . in the<br>
directory... (or makeit.bat)<br>
<br>
maybe you need something like... (I took the build command (and cmake<br>
command for the configuration of it)<br>
<br>
  if( MSVC )<br>
<br>
    if( NOT EXISTS ${BUILD}/${SOLUTION}.sln )<br>
<br>
      FILE( WRITE ${BUILD}/${SOLUTION}.sln )<br>
<br>
    endif()<br>
<br>
    if( ${CMAKE_MAKE_PROGRAM} MATCHES .*[Mm][Ss][Bb]uild.* )<br>
<br>
     build_command( BUILD_COMMAND CONFIGURATION ${CMAKE_BUILD_TYPE}<br>
PROJECT_NAME ${SOLUTION} TARGET INSTALL )<br>
<br>
          SET( MORE_ARGS /m:4 /v:m )<br>
<br>
    else()<br>
<br>
   build_command( BUILD_COMMAND CONFIGURATION ${CMAKE_BUILD_TYPE}<br>
PROJECT_NAME ${SOLUTION} TARGET INSTALL.vcxproj )<br>
<br>
    endif()<br>
<br>
    SEPARATE_ARGUMENTS( BUILD_COMMAND WINDOWS_COMMAND ${BUILD_COMMAND} )<br>
<br>
    SET( BUILD_COMMAND ${BUILD_COMMAND} ${MORE_ARGS} )<br>
<br>
    SET( ADD_SOURCES  SOURCES ${BUILD}/${SOLUTION}.sln )<br>
<br>
  else( MSVC )<br>
<br>
    build_command( BUILD_COMMAND CONFIGURATION ${CMAKE_BUILD_TYPE}<br>
PROJECT_NAME ${SOLUTION} TARGET install )<br>
<br>
    SEPARATE_ARGUMENTS( BUILD_COMMAND UNIX_COMMAND ${BUILD_COMMAND} )<br>
<br>
  endif( MSVC )<br>
<br>
<br>
<br>
<br>
---- Then later I had to -----<br>
<br>
  string (REPLACE &quot;;&quot; &quot; &quot; FAKE_BUILD_COMMAND &quot;${BUILD_COMMAND}&quot;)<br>
  FILE( APPEND ${BUILD}/${SCRIPTNAME} ${FAKE_BUILD_COMMAND} )<br>
<br>
I was writing the invokation to a file...  I don&#39;t know if the<br>
expansion from &#39;;&#39; to space is required if it&#39;s used with<br>
execute_process....<br>
<br>
EXECUTE_PROCESS(COMMAND ${BUILD_COMMAND} )<br>
<br>
<br>
 --- sample makeit.bat ---<br>
&quot;c:/tools/unix/cmake/bin/cmake.exe&quot; -G &quot;Visual Studio 11&quot; -T &quot;v110_xp&quot;<br>
 &quot;M:/sack/cmake_all/..&quot; -DCMAKE_BUILD_TYPE=debug<br>
-DCMAKE_INSTALL_PREFIX=C:/general/build/vs11-x86.monolithic/sack/debug_solution/../debug_out/core<br>
-DBUILD_MONOLITHIC=1 -D__NO_ODBC__= -DNEED_FREETYPE=1 -DNEED_JPEG=1<br>
-DNEED_PNG=1 -DNEED_ZLIB=1 -DBULLET_SOURCE=M:/bullet/source<br>
<br>
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe<br>
INSTALL.vcxproj /p:Configuration=debug /p:VisualStudioVersion=11.0<br>
/m:4 /v:m<br>
 --- end sample makeit.bat ---<br>
<div class=""><div class="h5"><br>
<br></div></div></blockquote><div><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">And Please understand I may be totally missing your point...<br>
<br>When is it that you want to run msbuild?<br><div class=""></div></blockquote></div><div> </div><div>As far as I know, I never run msbuild.</div><div><br></div><div>The command line Makefile driven system Erco put together (the non-FLTK download link from before) is a one-stop shop.</div>
<div><br></div><div>By running &#39;gmake.bat&#39;, it configures the program and then launches the build via gmake.exe.  I do not believe it ever creates a *.prj or *.sln file.  I do not believe it ever runs msbuild.  I believe gmake works with the Makefile to call the compiler via &#39;cl&#39; directly.</div>
<div><br></div><div>However, I haven&#39;t dug super deep into Erco&#39;s magic.</div><div><br></div><div>Rob</div><div><br></div><div><br></div><div><br></div><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">
<div class=""><div class="h5">
<br>
On Wed, Jan 8, 2014 at 7:50 PM, Rob McDonald &lt;<a href="mailto:rob.a.mcdonald@gmail.com">rob.a.mcdonald@gmail.com</a>&gt; wrote:<br>
&gt; Thanks for the tip, but that hasn&#39;t been very helpful to me.  Perhaps I&#39;m<br>
&gt; not doing it right.  Here is a bit of CMake code so the conversation can be<br>
&gt; more concrete...<br>
&gt;<br>
&gt; You&#39;ll need these two files...<br>
&gt;<br>
&gt; <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>

&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; Place them in the same directory with the following in the CMakeLists.txt<br>
&gt;<br>
&gt; CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )<br>
&gt;<br>
&gt; INCLUDE( ExternalProject )<br>
&gt;<br>
&gt; SET( VS_MAKEFILE_ZIP vsnet-makefiles.0.85.zip )<br>
&gt;<br>
&gt; ExternalProject_Add( FLTK<br>
&gt; URL ${CMAKE_SOURCE_DIR}/fltk-1.3.2-source.tar<br>
&gt; UPDATE_COMMAND<br>
&gt; ${CMAKE_COMMAND} -E copy_if_different<br>
&gt; ${CMAKE_SOURCE_DIR}/${VS_MAKEFILE_ZIP}<br>
&gt; &lt;SOURCE_DIR&gt;/${VS_MAKEFILE_ZIP}<br>
&gt; COMMAND<br>
&gt; ${CMAKE_COMMAND} -E tar -xzf &lt;SOURCE_DIR&gt;/${VS_MAKEFILE_ZIP}<br>
&gt;<br>
&gt; PATCH_COMMAND &quot;&quot;<br>
&gt; CONFIGURE_COMMAND &quot;&quot;<br>
&gt; BUILD_COMMAND &quot;&quot;<br>
&gt; INSTALL_COMMAND &quot;&quot;<br>
&gt; )<br>
&gt;<br>
&gt;<br>
&gt; To build this manually, first, unzip both files into the same directory.<br>
&gt; Then, launch the Visual Studio Command Prompt, usually accessed via the<br>
&gt; VS/vcvarsall.bat program included with Visual Studio.<br>
&gt;<br>
&gt; Once both files are unzipped into the same directory, and you are in the VS<br>
&gt; prompt environment, you can build FLTK using the batch program &#39;gmake.bat&#39;.<br>
&gt;<br>
&gt; For better or worse, it prompts the user to input for Debug or Release, and<br>
&gt; then for Verbose or Quiet.  If you make a simple text file with the entries<br>
&gt; one per line...<br>
&gt;<br>
&gt; ******* input.txt<br>
&gt; R<br>
&gt; Q<br>
&gt; *******<br>
&gt;<br>
&gt; You can feed that to the batch program thusly....<br>
&gt;<br>
&gt; gmake &lt; input.txt<br>
&gt;<br>
&gt; Alternately, if you can set DEBUG=R and VERBOSE=Q environment variables to<br>
&gt; the shell used to run &#39;gmake.bat&#39;, then you don&#39;t have to feed the text file<br>
&gt; for the user-input prompts.<br>
&gt;<br>
&gt; I tried something like the following....<br>
&gt;<br>
&gt; BUILD_COMMAND<br>
&gt;    ${CMAKE_COMMAND} --build &lt;SOURCE_DIR&gt; -- gmake<br>
&gt;<br>
&gt; But, it didn&#39;t seem to do anything useful....<br>
&gt;<br>
&gt; Rob<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Jan 8, 2014 at 5:31 PM, J Decker &lt;<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; cmake --build<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Jan 8, 2014 at 3:53 PM, Rob McDonald &lt;<a href="mailto:rob.a.mcdonald@gmail.com">rob.a.mcdonald@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Short version:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Does anyone have an elegant way to launch the visual studio command line<br>
&gt;&gt; &gt; from within CMake?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; James Bigler asked essentially this question back in March of 2011.<br>
&gt;&gt; &gt; David<br>
&gt;&gt; &gt; responded with a link to a Blog entry, but I haven&#39;t figured out how to<br>
&gt;&gt; &gt; translate that into something that works.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; The &#39;vcvarsall.bat&#39; program that comes with Visual Studio will launch<br>
&gt;&gt; &gt; the<br>
&gt;&gt; &gt; command line with the full environment set.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Once I find vcvarsall, I then need to launch something in it -- and pass<br>
&gt;&gt; &gt; parameters to that thing.  All from within ExternalProject_Add.  For<br>
&gt;&gt; &gt; now,<br>
&gt;&gt; &gt; one step at a time...<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Long version:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I&#39;m trying to encapsulate the build of FLTK as an ExternalProject in<br>
&gt;&gt; &gt; CMake.<br>
&gt;&gt; &gt; One way or the other, it needs to work for Visual Studio on Windows, and<br>
&gt;&gt; &gt; gcc<br>
&gt;&gt; &gt; and llvm on Linux/MacOS.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Although FLTK has a CMake build system, it is currently unmaintained<br>
&gt;&gt; &gt; (broken<br>
&gt;&gt; &gt; on at least some platforms), and none of the core FLTK developers use<br>
&gt;&gt; &gt; it, so<br>
&gt;&gt; &gt; I don&#39;t see this situation improving.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I&#39;ve got a ./configure based system working for Linux/MacOS.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; One of the FLTK developers maintains an unofficial Makefile setup for<br>
&gt;&gt; &gt; FLKT/Visual Studio that must be run from the Visual Studio command<br>
&gt;&gt; &gt; prompt.<br>
&gt;&gt; &gt; Hence my question...<br>
&gt;&gt; &gt;<br>
&gt;&gt; &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;&gt; &gt;<br>
&gt;&gt; &gt; Thanks for any help,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Rob<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt;&gt; &gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Kitware offers various services to support the CMake community. For more<br>
&gt;&gt; &gt; information on each offering, please visit:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
&gt;&gt; &gt; CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
&gt;&gt; &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;&gt; &gt;<br>
&gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div></div>