[CMake] Unneeded escaping: how to stop it?

Steven Van Ingelgem steven at vaningelgem.be
Mon Jan 28 11:49:39 EST 2008


Hi Brandon,


That was probably because it was too late to think clearly. I'm
normally already chaotic, but when I'm sleepy it is worse a factor
1000!

Please find enclosed a minimal example of what I tried to explain in
my previous mails.
The second "COMMAND" has been solved by "VERBATIM". But the first one
keeps eluding me and I think this is a bug in CMake (just updated CVS
version).


Greetings



On 28/01/2008, Brandon Van Every <bvanevery at gmail.com> wrote:
> On Jan 28, 2008 1:44 AM, Steven Van Ingelgem <steven at vaningelgem.be> wrote:
> > It didn't help very much though :S
> >
> > Now I get:
> > COMMAND if [ ! -e TEST ]; then echo ok && echo 2 && echo "test"; fi
> > ==>
> > if [ ! -e TEST "];" then echo ok "&&" "echo \"test\";" ">/dev/null" fi
> >
> >
> > So clearly the first case was better :)
>
> Could you please provide a trivial reproducer script using VERBATIM?
> I can't follow the e-mail threads of what you're actually having a
> problem with, you've skipped around from command to command to
> command.  By "trivial" I mean 1 line of mis-translating text, not a
> dump of whatever project you're working on.
>
>
> Cheers,
> Brandon Van Every
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------

SET(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOLEAN "" FORCE)


FIND_PROGRAM(BASH bash)


ADD_CUSTOM_COMMAND(
  OUTPUT TEST

# No VERBATIM output: if [ ! -e TEST ]; then echo here && PATH="hehe\ not\ a\ real\ path" echo we && echo are,\ born && echo to be kings fi
# VERBATIM output   : if [ ! -e TEST "];" then echo here "&&" "PATH=\"hehe not a real path\"" echo we "&&" echo "are, born" "&&" echo to be kings fi
  COMMAND      if [ ! -e "TEST" ]; then echo here && PATH="hehe not a real path" echo we && echo "are, born" && echo to be kings; fi

# No VERBATIM output: /bin/bash -c if\ [\ !\ -e\ "TEST"\ ];\ then\ echo\ here\ &&\ echo\ we\ &&\ echo\ "are,\ born"\ &&\ echo\ to\ be\ kings;\ fi
# VERBATIM output   : /bin/bash -c "if [ ! -e \"TEST\" ]; then echo here && echo we && echo \"are, born\" && echo to be kings; fi"
#  COMMAND ${BASH} -c "if [ ! -e \"TEST\" ]; then echo here && echo we && echo \"are, born\" && echo to be kings; fi"

  VERBATIM
)

ADD_CUSTOM_TARGET(
  TestTgt
  ALL
  DEPENDS
    TEST
)


More information about the CMake mailing list