[CMake] Problem with add_executable ( )

Andreas Pakulat apaku at gmx.de
Thu Feb 17 17:54:54 EST 2011


On 17.02.11 15:12:28, Enrique Izaguirre wrote:
> OK, I got it.
> The example I saw in the book is also without defining FILES. Then I have to
> set it to an initial value, that should be the path where the files are,
> right?

Yes usually you setup a variable with the relative path to the sources
of the target. I don't know what book you're reading but this simple
usecase usually looks like this:

set( MYEXEC_SRCS
      main.cpp
      subdir1/foo.cpp
      subdir2/bar.cpp
      baz.cpp
)

add_executable( myexec ${MYEXEC_SRCS} )

Andreas

-- 
You possess a mind not merely twisted, but actually sprained.


More information about the CMake mailing list