On 2010-03-17 20:21+0100 Michael Wild wrote:
Thing is, cmake is neither bash nor ksh, else it would be called cash ;-)
True, but COMMAND does execute a command on the command line, and on the Unix side of things that must involve the shell. To confirm that, note that the Makefiles generated by CMake have the following two lines (at least on Linux. I am sure other Unices have something similar to refer to the Bourne-compatible family of shells) # The shell in which to execute make rules. SHELL = /bin/sh So if CMake screws up standard sh syntax (and I am pretty sure that "Unix in a nutshell" does emphasize the lowest-common-denominator, bog-standard sh syntax), then CMake is crippled more than it needs to be.
To do what you want to do in a platform independent way, is to wrap your command in a .cmake script and in there use EXECUTE_PROCESS, where you have the OUTPUT_VARIABLE, OUTPUT_FILE, ERROR_VARIABLE and ERROR_FILE options.
That's a good idea for a single instance, but that might get a little complicated if you have hundreds of these. Dave's idea of a single shell script to work around this issue is pretty simple and should work for all my instances so that is what I will use. Despite the availability of workarounds, I still think a useful goal is for CMake not to mess up bog-standard sh syntax (such as the syntax covered in "Unix in a nutshell") so that the necessity of workarounds is considerably reduced. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
