Hi Karl, <br><br>You could do so something like that:<br><br>set(bitness 32)<br>if(CMAKE_SIZEOF_VOID_P EQUAL 8)<br>  set(bitness 64)  <br>endif()<br><br>The following macro provides a more complete example... <a href="http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/CMake/SlicerMacroGetPlatformArchitectureBitness.cmake?view=markup">http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/CMake/SlicerMacroGetPlatformArchitectureBitness.cmake?view=markup</a><span class="pygments-p"><br>

<br>#<br># SlicerMacroGetPlatformArchitectureBitness(&lt;var-prefix&gt;)<br># is used to extract information associated with the current platform.<br>#<br># The macro defines the following variables:<br>#  &lt;var-prefix&gt;_BITNESS - bitness of the platform: 32 or 64<br>

#  &lt;var-prefix&gt;_PLATFORM - which is on the this value: linux, macosx, win<br>#  &lt;var-prefix&gt;_ARCHITECTURE - which is on the this value: i386, amd64, ppc<br><br></span><br><br>Hth<br>Jc<br><br><br><div class="gmail_quote">

On Wed, Jun 22, 2011 at 7:33 PM, Karl Merkley <span dir="ltr">&lt;<a href="mailto:karl@elemtech.com">karl@elemtech.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
I need to install a library into a directory whose name depends on the machine type.   For example<br>
<br>
if (WIN32)<br>
  if (CMAKE_CL_64)<br>
      set(ARCH_DIR &quot;win32&quot;)<br>
  else()<br>
      set(ARCH_DIR &quot;win64&quot;)<br>
  endif()<br>
<br>
elseif (UNIX)<br>
  if (????)<br>
      set(ARCH_DIR &quot;linux32&quot;)<br>
  else()<br>
     set(ARCH_DIR &quot;linux64&quot;)<br>
endif()<br>
<br>
Is there a better way to do this?   The win64 version seems to work correctly.   What variable do I check for 32 vs 64 bit linux?<br>
<br>
  Thanks,<br>
        Karl<br>
<br>
<br>
<br>
<br>
<br>
<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><br clear="all"><br>-- <br>+1 919 869 8849<br><br>