[CMake] Problem with add_executable ( )

Andreas Pakulat apaku at gmx.de
Thu Feb 17 15:55:56 EST 2011


On 17.02.11 14:28:21, Enrique Izaguirre wrote:
> Thank you Andreas,
> 
> Yes, it is empty, but I tried now creating FILES this way before the
> foreach:
> 
> set (FILES "")
> 
> and still got the same result.
> 
> Is this way OK to create an empty variable?

You don't understand the problem, as long as FILES is empty, the
foreach() loop will not run and hence your hostFiles variable will not
be set. add_executable needs _at least_ 2 arguments, the name of the
target and at least one source file. You only supply 1 argument, the
target name, because your cmake variable is empty (or not set at all).
You need to supply actual source files.

Andreas

-- 
You own a dog, but you can only feed a cat.


More information about the CMake mailing list