[CMake] How to build for 32bit using multiarch?

Kishore Jonnalagadda kitts.mailinglists at gmail.com
Mon Nov 28 11:58:09 EST 2011


I have recently moved to using 64bit Kubuntu Oneiric when supports
multiarch. I understand that building 32 bit from my 64 install is as
simple as adding the "-m32" option to gcc. Asking cmake to add that
flag is easy but i don't know how to ask cmake to only look for 32 bit
libraries in FindPackage() class. I have all the 32bit library (Qt)
dependencies installed and they are in /usr/lib/i386-linux-gnu. By
adding the "-m32" option compilation succeeds but as expected linking
fails complaining that i am trying to link to 64 bit libraries.

So, how do i ask cmake to look for 32bit libs?
--
Cheers!
Kishore

Ps: Is this "multiarch" unique to *ubuntu or all distributions adopting it?


More information about the CMake mailing list