Thank you Andreas,<br><br>Yes, it is empty, but I tried now creating FILES this way before the foreach:<br><br>set (FILES "")<br><br>and still got the same result.<br><br>Is this way OK to create an empty variable?<br>
<br>Thanks<br><br>Enrique<br><br><div class="gmail_quote">On Thu, Feb 17, 2011 at 2:02 PM, Andreas Pakulat <span dir="ltr"><<a href="mailto:apaku@gmx.de">apaku@gmx.de</a>></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;">
<div><div></div><div class="h5">On 17.02.11 12:39:36, Enrique Izaguirre wrote:<br>
> Hello friends,<br>
><br>
> I have a problem when running cmake command, the add_executable ( ) is<br>
> giving me an error which I cannot see what is the problem. I have in my main<br>
> CMakeLists.txt files the following section:<br>
> ======================================<br>
> include (host/CMakeLists.txt)<br>
><br>
> foreach (FILE ${FILES})<br>
> set (hostFiles ${hostFiles} host/${FILE})<br>
> endforeach (FILE)<br>
><br>
> add_executable (mainprog ${hostFiles})<br>
> ======================================<br>
><br>
><br>
> After running the cmake command I got the following error:<br>
><br>
> Adding subdirectory host...<br>
> Entering host's CMakeLists<br>
> CMake Error at CMakeLists.txt:82 (add_executable):<br>
> add_executable called with incorrect number of arguments<br>
><br>
> My understanding is that add_executable can take from 2 arguments, is this<br>
> correct?<br>
><br>
> As shown above, I have in host/ subdirectory a CMakeLists.txt file with the<br>
> following:<br>
><br>
> set(CMAKE_INCLUDE_CURRENT_DIR ON)<br>
> message ("Entering host's CMakeLists")<br>
><br>
><br>
> and that's it.<br>
><br>
> What could be the problem?<br>
<br>
</div></div>You do not supply enough arguments to add_executable. Check what the<br>
value of ${hostFiles} is by using message(). I bet its empty given that<br>
you don't create FILES variable anywhere.<br>
<br>
Andreas<br>
<br>
--<br>
You've been leading a dog's life. Stay off the furniture.<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>