[CMake] Problem with add_executable ( )

Enrique Izaguirre enrique.izaguirre at gmail.com
Thu Feb 17 13:39:36 EST 2011


Hello friends,

I have a problem when running cmake command, the add_executable ( ) is
giving me an error which I cannot see what is the problem. I have in my main
CMakeLists.txt files the following section:
======================================
include (host/CMakeLists.txt)

foreach (FILE ${FILES})
    set (hostFiles ${hostFiles} host/${FILE})
endforeach (FILE)

add_executable (mainprog ${hostFiles})
======================================


After running the cmake command I got the following error:

Adding subdirectory host...
Entering host's CMakeLists
CMake Error at CMakeLists.txt:82 (add_executable):
  add_executable called with incorrect number of arguments

My understanding is that add_executable can take from 2 arguments, is this
correct?

As shown above, I have in host/  subdirectory a CMakeLists.txt file with the
following:

set(CMAKE_INCLUDE_CURRENT_DIR ON)
message ("Entering host's CMakeLists")


and that's it.

What could be the problem?

Thanks

Best Regards

Enrique
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110217/a8132d48/attachment.htm>


More information about the CMake mailing list