[CMake] evaluate a generator experssion

Nils Gladitz nilsgladitz at gmail.com
Wed Jan 14 07:17:21 EST 2015


On 14.01.2015 13:11, Biddiscombe, John A. wrote:
>
> file(WRITE “stuff containing above string”)
>
> the file is written with   "$<TARGET_FILE:hg_test_server>" inside it, 
> and not the full path/name of the target as I’d hoped.
>
> Is there a way to force the evaluation of the generator expression so 
> it is correctly written out into the launch script?
>

file(WRITE) is run at configuration time. Generator expressions are 
evaluated after configuration has finished (at generation time).
You can use file(GENERATE) to create files with generator expressions 
expanded at generation time.

Nils
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150114/744aa50b/attachment.html>


More information about the CMake mailing list