[CMake] Setting the compiler
Juan Sanchez
Juan.Sanchez at amd.com
Fri Jul 27 15:56:48 EDT 2007
Bill Hoffman wrote:
> Juan Sanchez wrote:
>> I'm evaluating CMAKE for use by our group and I am running into an issue
>> with selecting the compiler.
>>
>> Is there any way to set the compiler and flags in the CMakeLists.txt
>> file? This information appears to be ignored. The FAQ as well as the
>> book suggest setting environment variables.
>>
>> We have a script which we can use to determine the platform we are on,
>> but setting CMAKE_CXX_COMPILER in the if block of the CMakeLists.txt is
>> ignored.
>>
>> An issue is that it would be hard to convince other developers to adopt
>> CMAKE if this would require them to set environment variables every time
>> they check out the source code and start building. Another issue is
>> that they will be developing on both 32 and 64 bit machines, and would
>> like to be able to use the same directory to do this. The compiler on
>> each platform is in a different directory.
>>
> There really is not a way to do what you want. However, I don't see why
> requiring an environment variable
> is too much to ask? Most developers are going to have one compiler in
> their PATH, and cmake should
> pick it automatically. If they have more than one, it should not be
> that much to ask that they setup the
> environment so it is setup for the compiler they want to use. What are
> they currently doing?
>
> I suppose you could just create build scripts for each platform that
> setup the environment and ran cmake for them.
Hi Bill,
We are going to require the developer to run a specific compiler for a
32 bit build and a different one for the 64 bit build. That is the
preference for being able to set it in CMakeLists.txt, and just having
it work. Each developer is responsible for releasing the code on a
frequent basis, so everything has to be locked down. They also need to
be able to test their changes, before source check in, for both builds.
Requiring an environment variable is an issue that would cause someone
to complain. Making them run a build script for each platform would
also cause them to complain. If any of this triggers a massive
recompilation of the source files, that is another reason for them to
complain.
I like Cmake, and I really hope we are able to deploy it in our group.
My worry is that people aren't logical, and issues like the ones I
mention may be showstoppers for them, even if the workaround requires
minimal extra effort.
Regards,
Juan
>
> -Bill
>
>
>
--
Juan Sanchez
Juan.Sanchez at amd.com
800-538-8450 Ext. 54395
512-602-4395
More information about the CMake
mailing list