[CMake] how to compile as 32bit on a 64bit Linux host ?

Martin Koller martin.koller at etm.at
Tue Feb 19 10:46:19 EST 2013


On Friday 15 February 2013 16:26:39 Yngve Inntjore Levinsen wrote:
> Hello,
> 
> On 15/02/13 15:41, Martin Koller wrote:
> > I'm just not sure if it is enough to change the compiler flags or if
> > there is more to change (paths etc.)

I now found out that - for me - it's not enough to simply add the -m32 flags,
as our cmake files check ${CMAKE_SYSTEM_PROCESSOR} for various things, so
I need to use a toolchain file where I set this.
This also leads to the cmake var CMAKE_CROSSCOMPILING being set.

But what I now discovered is a problem with generated targets:
E.g. one subdir builds a tool which is used in another subdir to create
intermediate files.
That is:
add_executable(tool ...)
and the other dir uses it
add_custom_command(OUTPUT dbwork.h
                   COMMAND tool ...)

What I see is that cmake no longer finds the created tool.

When cross-compiling for e.g. the ARM CPU, I use export/import cmake files,
but this is not needed here as an i686 executable can run on an x86_64 CPU.

What do I have to give cmake so that it still finds the tool ?

-- 
Best regards/Schöne Grüße

Martin

A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments

This mail was not scanned before sending.
It was sent from a secure Linux desktop.


More information about the CMake mailing list