[CMake] output a string instead of a list

William A. Hoffman billlist at nycap.rr.com
Mon Jun 12 09:30:30 EDT 2006


At 08:28 AM 6/12/2006, Brandon J. Van Every wrote:

>You know I spoke too soon.  Once I changed that, I started getting semicolons in new places *inside of* quoted strings.  There is a general problem of semicolons, double quotes, and spaces in filenames beating each other up, as they are passed around between lists and strings and replacements are performed.  A list of defines like the following is highly problematic:
>
>-DHIERARCHICAL_INSTALL -DC_USE_C_DEFAULTS -DC_INSTALL_HOME="E:/Program Files/Chicken" -DC_INSTALL_BIN_HOME="E:/Program Files/Chicken/bin" -DC_INSTALL_INCLUDE_HOME="E:/Program Files/Chicken/include" -DC_INSTALL_LIB_HOME="E:/Program Files/Chicken/lib" -DHAVE_DIRECT_H -DHAVE_GCVT -DHAVE_STDINT_H -DHAVE_WINDOWS_H -DHAVE_LOADLIBRARY -DHAVE_GETPROCADDRESS -DHAVE_WINSOCK2_H -DHAVE_WS2TCPIP_H -DC_ENABLE_PTABLES -DC_STACK_GROWS_DOWNWARD=1
>
>I'll try to ask a specific question when I've got it back down to a specific problem again.  Until then, any general remedies?
Don't pass so much junk on the command line.  Configure a file.  It has several
benefits:

- it is easier to read
- if you need to compile a different project against the file, you
don't have to repeat the command line, you just need a single -I flag.
- it is VERY difficult to pass directories around on the command line that
will support spaces in the path and work cross platform with all the different shells.
It will almost certainly fail with some shell somewhere.

-Bill



More information about the CMake mailing list