How do you pass SOME_LIB="-lmylib -lmylib2" in a BUILD_COMMAND for ExternalProject_Add()?

Posted by Bill Katz on Stack Overflow See other posts from Stack Overflow or by Bill Katz
Published on 2012-11-13T22:56:55Z Indexed on 2012/11/13 22:59 UTC
Read the original article Hit count: 295

Filed under:

I'm trying to pass a quoted string through BUILD_COMMAND in ExternalProject_Add() and every way I try it's getting mangled. The code is this:

set (mylibs "-lmylib -lmylib2")
ExternalProject_Add(Foo
    URL             http://foo
    BUILD_COMMAND   make SOME_LIB=${mylibs}
    BUILD_IN_SOURCE 1
    ...)

I've tried using backslash quotes, double quotes, inlining the whole thing, but every time, either the whole SOME_LIB=... part gets quoted or my injected quotes get escaped. Is it not possible to get quotes through to the command line?

© Stack Overflow or respective owner

Related posts about cmake