[CMake] Trouble with EXTERNALPROJECT_ADD, configure, and CFLAGS

David Cole david.cole at kitware.com
Tue Oct 25 13:30:03 EDT 2011


On Tue, Oct 25, 2011 at 1:09 PM, Dan Kegel <dank at kegel.com> wrote:

> On Tue, Oct 25, 2011 at 10:05 AM, Dan Kegel <dank at kegel.com> wrote:
> >    CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/celt/configure -C
> --prefix=${CMAKE_BINARY_DIR}/prefix --disable-shared --with-pic  CFLAGS="-g
> -O2 -fPIC"
>
> Turns out the workaround is
>
>    CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/celt/configure -C
> --prefix=${CMAKE_BINARY_DIR}/prefix --disable-shared --with-pic
> CFLAGS=-g\ -O2\ -fPIC
>
> That's just freaky.  I've never seen backslashes and double-quotes
> behave differently like that.  I guess quotes are "stickier" in cmake
> than in shell.
> - Dan
> --
>
> 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
>

If that works, then I'm pretty sure you could also do:

"CFLAGS=-g -O2 -fPIC"

The call to cmake's ExternalProject_Add function is the thing that parses at
the space separation boundary. Having double quotes around the whole thing
that's supposed to be "one arg" to configure should work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111025/f019b6ca/attachment.htm>


More information about the CMake mailing list