I just found that unless I explicitly include ExternalProject.cmak in my cmake build, cmake won&#39;t find command &quot;ExternalProject_Add&quot;, which is pretty weird for me.<div>include(/usr/local/share/cmake-2.8/Modules/ExternalProject.cmake)</div>
<div><br></div><div>And now the problem is that if I use the following cmake script to build apr</div><div><br></div><div><div>   ExternalProject_Add(${LIB_NAME} </div><div>     PREFIX /home/xxx/prj/trunk/external/apr/1.3.9</div>
<div>     SOURCE_DIR /home/xxx/prj/trunk/external/apr/1.3.9</div><div>     CONFIGURE_COMMAND /home/xxx/prj/trunk/external/apr/1.3.9/configure --enable-static --disable-shared --disable-ipv6</div><div>     BINARY_DIR &quot;/home/xxx/prj/trunk/external/apr/1.3.9/.libs/&quot;</div>
<div>     BUILD_COMMAND make all</div><div>   )</div><div><br></div><div>CMake complains</div><div><br></div><div>  error: no download info for &#39;apr&#39; -- please specify existing SOURCE_DIR or</div><div>  one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY or</div>
<div>  DOWNLOAD_COMMAND</div><div><br></div><div>I have already specified the SOURCE_DIR, and I do not want the library is downloaded online. Is it a bug of CMake? Or I have done something wrong?</div><div><br></div><div class="gmail_quote">
On Sun, Feb 28, 2010 at 5:45 PM, Albert Z <span dir="ltr">&lt;<a href="mailto:amzproject@gmail.com">amzproject@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thanks, Luigi. However, I read the CMake 2.8 doc and tried to use function &quot;ExternalProject_Add&quot;. When I ran cmake in the root of my project, I got the following error<div><br></div><div>Unknown CMake command &quot;ExternalProject_Add&quot;</div>

<div><br></div><div>I tried on both linux and mac and got the same error. And I am sure the version of the cmake is 2.8</div><div><br></div><div>Best,</div><div>Meng</div><div><div></div><div class="h5"><div><br><br><div class="gmail_quote">
On Sun, Feb 28, 2010 at 4:50 AM, Luigi Calori <span dir="ltr">&lt;<a href="mailto:l.calori@cineca.it" target="_blank">l.calori@cineca.it</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Albert Z wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
  Our project now uses a bunch of 3rd party libraries such as apr, protobuf, libcurl, etc. Almost all of these libraries use autoconf (<a href="http://configure.in" target="_blank">configure.in</a> &lt;<a href="http://configure.in" target="_blank">http://configure.in</a>&gt;) based build system. Since we have some modifications to most of the libraries, we have to integrate these libraries to our cmake build tree. What is the easiest way to integrate such a 3rd-party library to a cmake build with keeping the maximum portability?<br>


</blockquote>
Try to look at ExternalProject module<br>
<a href="http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:ExternalProject" target="_blank">http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:ExternalProject</a><br>
and page 10 of <a href="http://www.kitware.com/products/archive/kitware_quarterly1009.pdf" target="_blank">http://www.kitware.com/products/archive/kitware_quarterly1009.pdf</a><br>
<br>
I have used it (with some mods): it allow to automate download pactch,build and install)<br>
Anyway, curl have recently included a CMakeLists in its distribution. I have used it even if had to apply some patches.<br>
I am trying to collect some cmake build recipes for some libraries I need.<br>
If you are interested, grab the stuff at<br>
bzr branch <a href="http://3d.cineca.it/storage/bazaar_repo/CmakeDeps/lib" target="_blank">http://3d.cineca.it/storage/bazaar_repo/CmakeDeps/lib</a><br>
<br>
HTH<br>
<br>
Luigi<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
------------------------------------------------------------------------<div><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>
</div></blockquote><div><div></div><div>
<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>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>