[CMake] Re: CMake and distcc
Rodolfo Lima
rodolfo at rodsoft.org
Thu Jan 17 09:47:22 EST 2008
Eric Noulard escreveu:
> 2008/1/17, Rodolfo Lima <rodolfo at rodsoft.org>:
>> Well, so redhat is doing something different than the rest. If you
>> compile and install gcc directly from the official tarball, it'll create
>> the i686-pc-linux-gnu symlink.
>>
>> Please try to invoke 'gcc -dumpmachine'. In my gentoo box, it outputs
>> 'i686-pc-linux-gnu. What's in yours?
>
> gcc -dumpmachine
> i386-redhat-linux
That's good. CMake might do the following (in a simplistic way):
# find the regular gcc (do as CMakeDetermineCCompiler.cmake does, tough)
find_program(CC_BASIC gcc)
# Discover the machine this gcc generates code to
execute_process(COMMAND ${CC_BASIC} -dumpmachine OUTPUT_VARIABLE MACHINE)
# Find a properly named gcc
find_program(CC_COMPLETE ${MACHINE}-gcc)
# Set CC to the above compiler if it exists.
if(CC_COMPLETE)
set(CC ${CC_COMPLETE})
else(CC_COMPLETE)
set(CC ${CC_BASIC})
endif(CC_COMPLETE)
Anyone agrees?
Regards,
rod
More information about the CMake
mailing list