[CMake] Custom-Targets with unknown outputs

Martin Apel martin.apel at simpack.de
Thu May 15 03:16:56 EDT 2008


Christoph Cullmann wrote:
> Am Mittwoch 14 Mai 2008 16:30:24 schrieben Sie:
>   
>> Are you sure the generated source file names are completely unpredictable?
>> Unless some random generator is being used, those names are probably
>> predictable, and it might be worth your while to look further into figuring
>> out how you can do that.
>>     
> The only thing predictable is the output directory (where atm a Makefile is 
> placed which we use with gmake + link the resulting library in the toplevel 
> makefile, as that name is known, too.). We can't predict them, as the code 
> generator generates one file per datatype and the datatypes are dynamic 
> dependend of the input file. To perdict them, in fact, the generator would 
> have to run.
>
>
>   
That's what I did for a similar problem: I modified the generator to 
output a list of generated files, when called with a special command 
line switch.
In this case the generator only generates the file list, not the files 
themselves. I ran this via EXECUTE_PROCESS at configuration time, so you 
have
the names of the generated files in a variable.
Of course this only works if you are able to modify the generator.

Martin
-- 


More information about the CMake mailing list