[CMake] setting CMAKE_C_COMPILER
Bill O'Hara
billtohara at gmail.com
Fri Feb 6 19:26:21 EST 2009
Thanks - that got me part of the way there and then
set(CMAKE_C_LINK_EXECUTABLE "${PURIFYCOMMAND} ${CMAKE_C_LINK_EXECUTABLE}")
for the link step.
thanks again
b.
On Fri, Feb 6, 2009 at 4:09 PM, Naram Qashat <cyberbotx at cyberbotx.com>wrote:
> Bill O'Hara wrote:
>
>> In my top-level CMakeLists.txt I'm trying to fiddle with the
>> CMAKE_C_COMPILER when certain CMAKE_BUILD_TYPEs are set. In particular if
>> the build type is purify then I'm trying to do this:
>>
>> set(CMAKE_C_COMPILER "${PURIFYCOMMAND} ${CMAKE_C_COMPILER}")
>>
>> The problem is that the resulting attempt to compile breaks because
>> /bin/sh is fed
>>
>> "/path/to/my/purify /path/to/my/gcc" hello.c
>>
>> complete with quote characters.. and sh promptly complains it can't find
>> any such command.
>>
>> Is this just a daft way to try to do this? Is there a recommended way to
>> extend the compiler command itself (rather than flags to the compiler)?
>>
>> b.
>>
>
> What you could do instead is set CMAKE_C_COMPILE_OBJECT, like so:
>
> set(CMAKE_C_COMPILE_OBJECT "${PURIFYCOMMAND} ${CMAKE_C_COMPILE_OBJECT}")
>
> That'll modify the command used to compile by prefixing it.
>
> Naram Qashat
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090206/7af93b4b/attachment-0001.htm>
More information about the CMake
mailing list