In a project where the CXX language has been enabled (project or enable_language commands), and there&#39;s only one architecture, you can use the following:<br><br>if(CMAKE_SIZEOF_VOID_P EQUAL 8)<br>  # 64-bit build<br>else()<br>
  # 32-bit build<br>
endif()<br><br>Or are you trying to build a universal binary and you have multiple OSX architectures in the containing project? If that&#39;s the case, then I&#39;m not sure off the top of my head. I&#39;d have to dig to figure it out...<br>
<br><br>Let us know if that helps,<br>David<br><br><br><div class="gmail_quote">On Fri, Jan 7, 2011 at 3:34 PM, kent williams <span dir="ltr">&lt;<a href="mailto:nkwmailinglists@gmail.com">nkwmailinglists@gmail.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;">This shouldn&#39;t be a big deal -- something like this should work:<br>
<br>
ExternalProject_add(OpenSSL<br>
   URL &quot;<a href="http://www.openssl.org/source/openssl-1.0.0c.tar.gz" target="_blank">http://www.openssl.org/source/openssl-1.0.0c.tar.gz</a>&quot;<br>
   URL_MD5 ff8fb85610aef328315a9decbb2712e4<br>
   CONFIGURE_COMMAND ./config --prefix=&quot;${CMAKE_CURRENT_BINARY_DIR}/OpenSSL&quot;<br>
   BUILD_IN_SOURCE 1<br>
    INSTALL_DIR &quot;${CMAKE_CURRENT_BINARY_DIR}/OpenSSL&quot;<br>
  )<br>
set(OPENSSL_INCLUDE_DIR &quot;${CMAKE_CURRENT_BINARY_DIR}/OpenSSL/include&quot;)<br>
link_directories(&quot;${CMAKE_CURRENT_BINARY_DIR}/OpenSSL/libs)<br>
set(OPENSSL_LIBRARIES ssl ssleay32 ssleay32MD)<br>
<br>
The problem is that OpenSSL doesn&#39;t handle configuration scripts in<br>
the usual way -- the configure script wants you to specify your<br>
platform/compiler string.<br>
<br>
They provide an &#39;automatic&#39; script instead called config, so<br>
<br>
config --prefix=...<br>
<br>
Does mostly what you want, but they make you handle the OS X 64-bit<br>
case manually -- it wants you to run configure and tell it explicitly<br>
about the platform:<br>
<br>
./Configure darwin64-x86_64-cc<br>
<br>
This is kind of crazy, but OK, whatever. So I need to try and figure<br>
out at configure time if it&#39;s an OS X build and if it&#39;s a 64 bit<br>
build.  I can use<br>
<br>
if(APPLE)<br>
<br>
to detect an Mac platform, but there&#39;s no way I can figure out to<br>
determine if the currently selected build type is 64 bits.  And I<br>
think that the stock OpenSSL distribution would completely lose its<br>
mind if you tried to configure a Universal Binary build!<br>
<br>
Any suggestions?<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>