<div dir="ltr">Very sorry for not replying to the list, I certainly meant to. I didn'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'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"><<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@gmail.com</a>></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 "cmake ..." command that has all the required options and<br>
switches (I'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 ";" " " FAKE_BUILD_COMMAND "${BUILD_COMMAND}")<br>
FILE( APPEND ${BUILD}/${SCRIPTNAME} ${FAKE_BUILD_COMMAND} )<br>
<br>
I was writing the invokation to a file... I don't know if the<br>
expansion from ';' to space is required if it's used with<br>
execute_process....<br>
<br>
EXECUTE_PROCESS(COMMAND ${BUILD_COMMAND} )<br>
<br>
<br>
--- sample makeit.bat ---<br>
"c:/tools/unix/cmake/bin/cmake.exe" -G "Visual Studio 11" -T "v110_xp"<br>
"M:/sack/cmake_all/.." -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 'gmake.bat', 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 'cl' directly.</div>
<div><br></div><div>However, I haven't dug super deep into Erco'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 <<a href="mailto:rob.a.mcdonald@gmail.com">rob.a.mcdonald@gmail.com</a>> wrote:<br>
> Thanks for the tip, but that hasn't been very helpful to me. Perhaps I'm<br>
> not doing it right. Here is a bit of CMake code so the conversation can be<br>
> more concrete...<br>
><br>
> You'll need these two files...<br>
><br>
> <a href="http://www.fltk.org/software.php?VERSION=1.3.2&FILE=fltk/1.3.2/fltk-1.3.2-source.tar.gz" target="_blank">http://www.fltk.org/software.php?VERSION=1.3.2&FILE=fltk/1.3.2/fltk-1.3.2-source.tar.gz</a><br>
> <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>
><br>
> Place them in the same directory with the following in the CMakeLists.txt<br>
><br>
> CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )<br>
><br>
> INCLUDE( ExternalProject )<br>
><br>
> SET( VS_MAKEFILE_ZIP vsnet-makefiles.0.85.zip )<br>
><br>
> ExternalProject_Add( FLTK<br>
> URL ${CMAKE_SOURCE_DIR}/fltk-1.3.2-source.tar<br>
> UPDATE_COMMAND<br>
> ${CMAKE_COMMAND} -E copy_if_different<br>
> ${CMAKE_SOURCE_DIR}/${VS_MAKEFILE_ZIP}<br>
> <SOURCE_DIR>/${VS_MAKEFILE_ZIP}<br>
> COMMAND<br>
> ${CMAKE_COMMAND} -E tar -xzf <SOURCE_DIR>/${VS_MAKEFILE_ZIP}<br>
><br>
> PATCH_COMMAND ""<br>
> CONFIGURE_COMMAND ""<br>
> BUILD_COMMAND ""<br>
> INSTALL_COMMAND ""<br>
> )<br>
><br>
><br>
> To build this manually, first, unzip both files into the same directory.<br>
> Then, launch the Visual Studio Command Prompt, usually accessed via the<br>
> VS/vcvarsall.bat program included with Visual Studio.<br>
><br>
> Once both files are unzipped into the same directory, and you are in the VS<br>
> prompt environment, you can build FLTK using the batch program 'gmake.bat'.<br>
><br>
> For better or worse, it prompts the user to input for Debug or Release, and<br>
> then for Verbose or Quiet. If you make a simple text file with the entries<br>
> one per line...<br>
><br>
> ******* input.txt<br>
> R<br>
> Q<br>
> *******<br>
><br>
> You can feed that to the batch program thusly....<br>
><br>
> gmake < input.txt<br>
><br>
> Alternately, if you can set DEBUG=R and VERBOSE=Q environment variables to<br>
> the shell used to run 'gmake.bat', then you don't have to feed the text file<br>
> for the user-input prompts.<br>
><br>
> I tried something like the following....<br>
><br>
> BUILD_COMMAND<br>
> ${CMAKE_COMMAND} --build <SOURCE_DIR> -- gmake<br>
><br>
> But, it didn't seem to do anything useful....<br>
><br>
> Rob<br>
><br>
><br>
> On Wed, Jan 8, 2014 at 5:31 PM, J Decker <<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>> wrote:<br>
>><br>
>> cmake --build<br>
>><br>
>> On Wed, Jan 8, 2014 at 3:53 PM, Rob McDonald <<a href="mailto:rob.a.mcdonald@gmail.com">rob.a.mcdonald@gmail.com</a>><br>
>> wrote:<br>
>> > Short version:<br>
>> ><br>
>> > Does anyone have an elegant way to launch the visual studio command line<br>
>> > from within CMake?<br>
>> ><br>
>> > James Bigler asked essentially this question back in March of 2011.<br>
>> > David<br>
>> > responded with a link to a Blog entry, but I haven't figured out how to<br>
>> > translate that into something that works.<br>
>> ><br>
>> > The 'vcvarsall.bat' program that comes with Visual Studio will launch<br>
>> > the<br>
>> > command line with the full environment set.<br>
>> ><br>
>> > Once I find vcvarsall, I then need to launch something in it -- and pass<br>
>> > parameters to that thing. All from within ExternalProject_Add. For<br>
>> > now,<br>
>> > one step at a time...<br>
>> ><br>
>> > Long version:<br>
>> ><br>
>> > I'm trying to encapsulate the build of FLTK as an ExternalProject in<br>
>> > CMake.<br>
>> > One way or the other, it needs to work for Visual Studio on Windows, and<br>
>> > gcc<br>
>> > and llvm on Linux/MacOS.<br>
>> ><br>
>> > Although FLTK has a CMake build system, it is currently unmaintained<br>
>> > (broken<br>
>> > on at least some platforms), and none of the core FLTK developers use<br>
>> > it, so<br>
>> > I don't see this situation improving.<br>
>> ><br>
>> > I've got a ./configure based system working for Linux/MacOS.<br>
>> ><br>
>> > One of the FLTK developers maintains an unofficial Makefile setup for<br>
>> > FLKT/Visual Studio that must be run from the Visual Studio command<br>
>> > prompt.<br>
>> > Hence my question...<br>
>> ><br>
>> > <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>
>> ><br>
>> > Thanks for any help,<br>
>> ><br>
>> > Rob<br>
>> ><br>
>> ><br>
>> ><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:<br>
>> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>> ><br>
>> > Kitware offers various services to support the CMake community. For more<br>
>> > 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/support.html</a><br>
>> > CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
>> > CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
>> ><br>
>> > Visit other Kitware open-source projects at<br>
>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/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/listinfo/cmake</a><br>
><br>
><br>
</div></div></blockquote></div><br></div></div>