[CMake] 64bit linking on linux

Hendrik Sattler post at hendrik-sattler.de
Wed Feb 18 14:17:56 EST 2009


Am Mittwoch 18 Februar 2009 15:52:18 schrieb Bill Hoffman:
> That is not the preferable way to do this.  As it hard codes flags into
> the CMake file.  The way I would do it is:
>
> export CXXFLAGS=-m64
> export CFLAGS=-m64
> export LDFLAGS=-m64
>
> cmake ../myproject
>
> If those environment variables are set BEFORE you run cmake, then cmake
> will put them into the cache correctly.

Actually, using the cross-compilation feature seems more logical as his host-
cc obviously produces 32bit binaries. This also means that if he needs to link 
against libraries, etc., it is the same as compiling for a completely different 
architecture.

Having a 64bit system with a gcc default of -m32 is just a silly thing.

HS



More information about the CMake mailing list