I do exactly that for my project using these lines:<br><br>if(UNIX)<br>    # only build 32-bit binaries<br>    add_definitions(                        -m32) <br>    set(CMAKE_EXE_LINKER_FLAGS                &quot;${CMAKE_EXE_LINKER_FLAGS} -m32&quot;)<br>
    set(CMAKE_SHARED_LIBRARY_C_FLAGS        &quot;${CMAKE_SHARED_LIBRARY_C_FLAGS} -m32&quot;)<br>    set(CMAKE_SHARED_LIBRARY_CXX_FLAGS        &quot;${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -m32&quot;)<br>endif()<br><br><br>I do it unconditionally but you could easily add an option variable to turn this behaviour on or off accordingly.<br>
--<br>Glenn<br><br><br><div class="gmail_quote">On 26 May 2011 17:54, Sara Rolfe <span dir="ltr">&lt;<a href="mailto:smrolfe@u.washington.edu">smrolfe@u.washington.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br>
<br>
I&#39;d like to force a 64-bit machine to build a 32-bit program.  Can I control this using CMake?<br>
<br>
Thanks,<br>
Sara<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br>