[CMake] 32 bits compilation on x64 platform - how to find system libraries

Mathieu Malaterre mathieu.malaterre at gmail.com
Mon Dec 7 07:19:17 EST 2009


On Mon, Dec 7, 2009 at 11:43 AM, Marcel Loose <loose at astron.nl> wrote:
> Hi Olivier,
>
> I think you need to set the global property FIND_LIBRARY_USE_LIB64_PATHS
> to OFF.
>
> BTW, I disagree with Mathieu that building 32-bit libraries/executables
> on a 64-bit system is cross-compilation. These binaries can be run
> without a problem on the host system. So, IMHO, you don't need a
> toolchain file. The only thing you have to do is instruct gcc/g++ to
> generate 32-bit objects/binaries, using the -m32 option, and tell CMake
> to look in lib instead of lib64 by setting the aforementioned property.


There is two things from the top of my head:
1. ia64 which is not x86 compatible
2. You still need a libz/libpng/libjpeg compiled as 32bits on your
amd64 system...

I think the project needs to be self contained (convenient libs)
otherwise to get it compiled using the -m32 trick

2cts
-- 
Mathieu


More information about the CMake mailing list