STRING(REGEX REPLACE "/" "\\" BINDIR ${JavaR2_BINARY_DIR}) Actually. Cmake won't allow me to do this. It reports that sequence is not allowed to end in \ If I try to fool it by adding a space or similar afterwards it says invalid escape sequence. It looks as though something is wrong somewhere. Am I missing an escape character somewhere. I've tried several combinations JB