find_program doesn't detect the difference between 64 and 32 bit executable, so I need to augment the search paths to avoid looking in 64 bit locations on a 32 bit system.<br><br>James<br><br><div class="gmail_quote">On Mon, Oct 26, 2009 at 6:55 PM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Win64, in a 32-bit calling environment, there are two environment variables with values like this:<div>
<div>PROCESSOR_ARCHITECTURE=x86</div><div>PROCESSOR_ARCHITEW6432=AMD64</div><div><br></div>In a pure 64-bit calling environment, there is just:</div>
<div>PROCESSOR_ARCHITECTURE=AMD64</div><div>(and no value for PROCESSOR_ARCHITEW6432)</div><div><br></div><div>...so: you could do something like this (although it may not be 100% foolproof...):</div><div>if("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")</div>
<div> if("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")</div><div> # "pure" 32-bit environment...</div><div> else()</div><div> # "pure" 64-bit environment...</div><div> endif()</div>
<div>else()</div><div> if("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")</div><div> # 32-bit program running with an underlying 64-bit environment available...</div><div> else()</div><div> # theoretically impossible case...</div>
<div> endif()</div><div>endif()</div><div><br></div><div>Of course, it would be better to not have conditionals based on the environment... Why do you need to do this?</div><div><br></div><div><br></div><div>HTH,</div><div>
David</div><div><br></div><div><br><div class="gmail_quote"><div><div></div><div class="h5">On Mon, Oct 26, 2009 at 6:46 PM, James Bigler <span dir="ltr"><<a href="mailto:jamesbigler@gmail.com" target="_blank">jamesbigler@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
All the WIN32 flags say they are valid for WIN64 machines. Is there no equivalent WIN64 flag to determine if the OS is 32 or 64 bit regardless of the bitness of the build?<br><br>Thanks,<br><font color="#888888">James<br>
</font><br></div></div>_______________________________________________<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></div>
</blockquote></div><br>