[CMake] Linux 64 bit woes

Michael Wild themiwi at gmail.com
Thu Mar 27 06:04:10 EDT 2008


On 27Mar, 2008, at 9:27, Andreas Schneider wrote:
> Robert Bielik wrote:
>> I'm compiling under Ubuntu and want to generate 64 bit code. Is  
>> there a way to get cmake to generate
>> the correct settings in the Makefile ?
>> I tried adding -m64 (and -march=x86-64) but the __x86_64__ define  
>> does not seem to be set. I.e. when using
>
> This define is set by the compiler not by the build system.
>
>
>

To see what defines are set by gcc, you can use

gcc -dM -E - < /dev/null

Very useful... For the 64 bit case, I added -m64 to the options on my  
32 Bit Ubuntu box (Gutsy): __x86_64 and __x86_64__ are both defined.


HTH

Michael


More information about the CMake mailing list