I normally avoid using embedded blanks in directory names on Linux (Debian Lenny, CMake-2.8.0), but I am trying to help out one of my colleagues who is using embedded blanks in directory names in the Windows case. He does have access to bash via win-bash. However, before I can replicate his issue, I have to sort out the Linux CMake issues with embedded blanks, and any help with that would be much appreciated.
The PLplot test system assumes bash (either normal bash or win-bash) is available and uses environment variables specified on the command line. Here is a simple example of this. COMMAND DUMMY=${CMAKE_CURRENT_BINARY_DIR} printenv DUMMY This works fine if there are no embedded blanks in CMAKE_CURRENT_BINARY_DIR, and the bash result of the above cmake COMMAND in a custom target is DUMMY=/home/software/plplot_svn/HEAD/build_dir/examples printenv DUMMY with the expected output /home/software/plplot_svn/HEAD/build_dir/examples However, if CMAKE_CURRENT_BINARY_DIR has an embedded blank, e.g., /home/software/plplot svn/HEAD/build_dir/examples then the resulting generated command is "DUMMY=/home/software/plplot svn/HEAD/build_dir/examples" printenv DUMMY which gives the bash error /bin/sh: DUMMY=/home/software/plplot svn/HEAD/build_dir/examples: No such file or directory because bash does not like quotes around variable assignment statements. To solve this issue, VERBATIM should simply put the quotes around everything after the equal sign when there are embedded blanks, e.g., DUMMY="/home/software/plplot svn/HEAD/build_dir/examples" printenv DUMMY which I have verified works fine on the bash command line. If the CMake developers here agree that is a VERBATIM bug, I will write up the appropriate bug report in the cmake bug tracker to keep track of the issue. The non-VERBATIM case gives the same bad result (quotes around the variable assignment). However, I did find a clumsy workaround in that case which is to put something innocuous that does not have an embedded blank as the first part of the command, e.g., COMMAND DUMMY= DUMMY=${CMAKE_CURRENT_BINARY_DIR} printenv DUMMY For some reason, in the non-VERBATIM case only the first blank-delimited part of the command is always quoted if it has an embedded blank and subsequent parts of the command use an escaped blank instead. So the above COMMAND in the non-VERBATIM case results in the generated command, DUMMY= DUMMY=/home/software/plplot\ svn/HEAD/build_dir/examples printenv DUMMY which works fine. Until the VERBATIM bug gets fixed, is there some better way (other than the above clumsy non-VERBATIM workaround) to deal with embedded blanks in bash variable assignment statements? 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