Help Rewriting kdepim/akonadi/agents/nie/CMakeLists.txt

Andreas Pakulat apaku at gmx.de
Wed Jul 23 23:11:03 CEST 2008


On 23.07.08 16:42:15, Allen Winter wrote:
> On Wednesday 23 July 2008 16:38:09 Andreas Pakulat wrote:
> > On 23.07.08 16:14:30, Allen Winter wrote:
> > > I need help from the CMake Gurus.
> > > 
> > > Attached is my attempt at rewriting kdepim/akonadi/agents/nie/CMakeLists.txt.
> > > 
> > > The problem is:  the nepomuk-rcgen program creates a file that contains a list
> > > of source files to compile into the nie library.
> > > 
> > > So you'll notice that I read the contents of the file into a variable and attempt
> > > to use that in kde4_add_library().  But CMake complains that the input files
> > > don't exist. 
> > > 
> > > I'm lost.
> > 
> > Well, as far as I understand you don't know the filenames before running
> > the external command right? I think your only option then is to set the
> > generated flag on the source files once you have them via
> > 
> > set_source_files_property( ${SOURCES} PROPERTIES GENERATED TRUE )
> > 
> > If you know the filenames before running the custom command you can just
> > add the names to the OUTPUT list and cmake will know they're generated.
> > 
> I do know the name of the files beforehand.
> I think I tried what you suggest and it doesn't help.

Note: I was talking about the generated source files, not the file
you're reading in again. This ought to work and actually works just fine
for kdevelop where we use a parser-generator to generate some sources
(using custom_command and OUTPUT). And it works with the source-file
property for the java plugin which uses flex to generate a lexer source
file. 

And it works fine with a small test too:
,----
| set_source_files_property( foo.cpp PROPERTIES GENERATED TRUE )
| 
| add_executable( bar foo.cpp )
`----

Andreas

-- 
A tall, dark stranger will have more fun than you.


More information about the Kde-buildsystem mailing list