[CMake] Would it be possible to have cmake make final binaries?

Michael Wild themiwi at gmail.com
Tue Aug 31 14:47:51 EDT 2010


On 31. Aug, 2010, at 19:02 , Clinton Stimpson wrote:

> On Tuesday, August 31, 2010 09:33:18 am Mark Roden wrote:
>> Hi all,
>> 
>> I'm wondering if it would be possible to have CMake bypass IDEs altogether
>> and just produce the final, installed results.
>> 
>> Right now, I do this:
>> 1) download source
>> 2) configure source
>> 3) tweak settings
>> 4) configure source again
>> 5) Probably configure a third time, depending on what CMake wants to make
>> the 'generate' button show up
>> 6) generate code
>> 7) open IDE
>> 8) select build style (debug, release, etc)
>> 9) build
>> 10) build install
>> 11) use libraries/exes/etc
>> 
>> Would it be possible to combine steps 6-10 with a single button in CMake?
>> That is, have a CMake default flag that is 'build style', and have that be
>> something like 'debug' (which corresponds to a set of compiler switches,
>> etc), 'release' (other switches), and so forth.  Have that show up as a
>> simple option when configuring.  Then, rather than having to go through all
>> subsequent steps, just have a third button that is 'build and install',
>> that just goes right to building and installing?
>> 
>> The idea is that if I need to set up a development environment on a new
>> machine, or recover from a crash, or the like, I should be able to download
>> the source and (ideally) press a single button to make it happen.
>> 
>> I've followed this style:
>> http://www.joelonsoftware.com/articles/fog0000000043.html
>> 
>> for a while now, and having the one-button deployment really shows
>> weaknesses in the process, as well as really helps have end users get to
>> what they actually want, which is an installed, usable version of the code
>> that they downloaded.  It's like running ./configure; make; make install
>> from the command line, but in delicious GUI form and allowing you to easily
>> flip whatever switches you want in step 3 above.
>> 
>> Make sense?  Good idea/bad idea?
> 
> See:
> http://cmake.org/Bug/view.php?id=8260
> http://cmake.org/Bug/view.php?id=8664
> 
> Feel free to add your comments to that.
> I think its a good idea.
> 
> As for the "Joel Test" you gave a link to, one can already do #2 and #3 with a 
> ctest script.  But yeah, have a GUI button as well would be nice.
> An issue is that there are multiple things that "one" button can do.
> 
> Clint

Yeah, I implemented this magic button some time ago, but wasn't too happy about the experience myself. First, there's the large output which probably should also be logged to a file (not too hard), and secondly there was the problem of obtaining a progress report from IDE build systems. For Makefile based generators I simply parsed the progress from the output, but IDE generators don't have this useful output. The "stop" action I was able to implement rather elegantly (although I had to hack the cmSystemTools class).

What was still missing is, as already mentioned, progress information for non-Makefile generators and a "open-in-IDE" button. Qt has the facility to open a file with the default application, so that's there. What I was missing was a reliable way of obtaining the name of the project file in
the first place.

Also, the patch doesn't apply cleanly anymore and I don't have the time to rework it right now.

Michael


More information about the CMake mailing list