<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Le mer. 29 août 2018 à 14:44, George PF <<a href="mailto:george.p.f@mail.com">george.p.f@mail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
> <br>
> My opinion (but I may be proven wrong by others) is that genex contains<br>
> generator specific bits that cannot be **evaluated**<br>
> until the build system is generated. Properties (on target, or directory,<br>
> or files) contains informations that is available as soon<br>
> as the corresponding CMakeLists.txt part defining the object has been<br>
> processed.<br>
<br>
That seems more like an internal cmake limitation. Though maybe on purpose so <br>
the scripts can not be tailored for just one backend.<br></blockquote><div><br></div><div>I think this was a design choice thus the name "Generator" expression they are evaluated at generation time</div><div>not configuration time and I don't think it's an internal cmake limitation, I think (but I may be wrong) that this</div><div>"generation step" would happen for any generative build system.</div><div><br></div><div>And there is more than that about "when" you'll know some var values.</div><div>Some generators are supporting "multiple build configuration" like MSVC and Xcode so that</div><div>the build output dir is "mangled" with a prefix **at build time** (since you can switch configuration after you have generated your project files).</div><div>see e.g. </div><div><a href="https://cmake.org/cmake/help/latest/variable/CMAKE_CFG_INTDIR.html">https://cmake.org/cmake/help/latest/variable/CMAKE_CFG_INTDIR.html</a></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
And the documentation says quite optimistically: "Generator expressions are allowed <br>
in the context of many target properties", a more restrictive phrasing - "only works <br>
with X / Y for reasons Z" would help there.</blockquote><div><br></div><div>I agree this could be clearer.</div><div>Having a possibly exhaustive description of where genex may be used would be nice.</div><div>May be it's worth a bug report with a proposal doc update?<br></div><div><br></div><div>Genex support is added in places where it is useful (and possible I guess):</div><div><a href="https://gitlab.kitware.com/cmake/cmake/issues/15374">https://gitlab.kitware.com/cmake/cmake/issues/15374</a><br></div><div><a href="https://gitlab.kitware.com/cmake/cmake/issues/15785">https://gitlab.kitware.com/cmake/cmake/issues/15785</a><br></div><div><br></div><div><div>And concerning having them "at configure time", there is open issue</div><div>about "configuration expression":</div><div><a href="https://gitlab.kitware.com/cmake/cmake/issues/17962">https://gitlab.kitware.com/cmake/cmake/issues/17962</a><br></div></div><div><br></div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div></div>