[CMake] Set variable value based on generated files

Michael Wild themiwi at gmail.com
Tue Jun 1 15:57:36 EDT 2010


On 1. Jun, 2010, at 17:02 , Hariharan wrote:

> I do use ADD_CUSTOM_COMMAND to generate the files, but the actual generation
> is done by a different Perl script. In some cases, there is no direct
> correlation between the name of the source file and the name of the
> destination file; and the number of generated files is quite large. However,
> assuming I could get a list of the generated files from the script, is there
> any way I can use that information (can i set the sources to this, for
> example) ?
> This output would be the actual list of files that I need to compile.
> 
> On your second point, forgive my ignorance, but it's not clear to me what
> the disadvantage of using file(GLOB) is in this case (I want to satisfy my
> curiosity). Are you saying that CMake will not know if there is a new
> generated file, so I will have to rebuild?

Just re-run CMake is what you'll have to do. And the biggest disadvantage is what you're seeing now: CMake can't generate a correct build system.

Michael 


More information about the CMake mailing list