If it builds with CMake, then just give it these arguments:<div><br></div><div> INSTALL_DIR ${CMAKE_BINARY_DIR}/install</div><div> CMAKE_ARGS</div><div> -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR></div><div><br></div><div>
and leave off the INSTALL_COMMAND, accepting the default install command that ExternalProject already uses. That should work everywhere.</div><div><br></div><div>The thing you're trying to do would work if you did it like this, without the double quotes:</div>
<div><br></div><div> INSTALL_COMMAND cp ${CMAKE_SOURCE_DIR}/contrib/blas/blas_LINUX.a ${CMAKE_BINARY_DIR}/<br></div><div><br></div><div>But obviously, that will only work where there's a "cp" command, and on Linux, since the blas_LINUX.a file probably only works on Linux. (And it generally doesn't work to simply copy library files around as an install step...)<br>
<br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">On Fri, Jul 13, 2012 at 8:21 PM, Martin Vymazal <span dir="ltr"><<a href="mailto:martin.vymazal@vki.ac.be" target="_blank">martin.vymazal@vki.ac.be</a>></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 would like to add blas as external project to my code (which already uses<br>
cmake), and I'm playing with ExternalProject_Add<br>
<br>
I downloaded blas and extracted its sources to the directory<br>
${CMAKE_SOURCE_DIR}/contrib/blas<br>
<br>
The compilation runs fine and generates blas_LINUX.a, but I cannot install the<br>
library. For testing purposes, I would like to move it to the build tree. I<br>
tried:<br>
<br>
ExternalProject_Add(BlasTest<br>
...<br>
INSTALL_COMMAND "cp ${CMAKE_SOURCE_DIR}/contrib/blas/blas_LINUX.a<br>
${CMAKE_BINARY_DIR}/"<br>
)<br>
<br>
Unfortunately, this fails:<br>
<br>
/bin/sh: cp /home/martin/BlasExtProject/contrib/blas/blas_LINUX.a<br>
/home/martin/BlasExtProject/build/: No such file or directory<br>
<br>
This happens after running:<br>
cd /home/martin/BlasExtProject/build<br>
cmake ..<br>
make<br>
<br>
Could you please help me to get this right?<br>
I'm not sure that this approach as a whole is a good practice. If it's not,<br>
please suggest a better one.<br>
<br>
Thank you.<br>
<br>
Best regards,<br>
<br>
Martin Vymazal<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></div>