[CMake] Finding 32bit libs on 64bit Ubuntu install

Nils Gladitz nilsgladitz at gmail.com
Mon Apr 25 14:15:44 EDT 2016


On 22.04.2016 20:59, Nick Deubert wrote:
> Hey everyone, I am trying to build and link some 32bit binaries on
> Ubuntu 15.10 64bit, but no matter what combination of arguments I give
> FIND_LIBRARY I cannot get it to use the 32bit libs. I have been
> scouring the mailing lists and came up with all these things to try
> but nothing has worked so far. I am using cmake 3.0.2. Please let me
> know what I am missing. Thanks in advance for your help.
> Nick

Run cmake e.g. like this:
     CC="gcc -m32" CXX="g++ -m32" cmake ..

Don't try to add -m32 within the project.
This way the try_compile() tests that cmake runs will correctly 
determine that you are building 32-bit and find_library() will use the 
correct paths.

Make sure you start with a fresh build directory.

Nils


More information about the CMake mailing list