[CMake] How to set environment variables with spaces in commands

Qingping Hou dave2008713 at gmail.com
Sat Dec 12 03:22:11 EST 2015


On Wed, Dec 9, 2015 at 9:52 PM, Attila Krasznahorkay
<attila.krasznahorkay at gmail.com> wrote:
> Probably not the intended solution, but what I’m doing in such cases is that in a patch step I create a shell script that does the configuration for me. With all the environment settings and everything. Like:
>
> PATCH_COMMAND ${CMAKE_COMMAND} -E echo “cd someDir/; CC=\”something\” ./configure” > configure.sh
> CONFIGURE_COMMAND sh configure.sh

Thanks Attila for the tip. In fact, since you are already constructing
the command as a string, why not just run it through sh?

CONFIGURE_COMMAND sh “cd someDir/; CC=\”something\” ./configure”


More information about the CMake mailing list