[CMake] Detecting -m32 build target on 64-bit host

Nils Gladitz nilsgladitz at gmail.com
Thu Apr 23 10:57:19 EDT 2015


On 04/23/2015 04:54 PM, Mateusz Loskot wrote:
> Hi,
>
> Surprisingly, I'm having trouble to figure out how to determine,
> that in Linux 64-bit OS, I'm building a project with -m32 specified.
> IOW, any CMake variable or macro to tell me target architecture
> of a build that is being configured is 32 or 64 bit?

CMAKE_SIZEOF_VOID_P [1] should be:
   - 4 for 32-bit builds
   - 8 for 64-bit builds

Nils

[1] http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_SIZEOF_VOID_P.html


More information about the CMake mailing list