<div dir="ltr">I cc the list because I think you drop it inadvertently.<br><br><div class="gmail_quote"><div dir="ltr">Le mar. 28 août 2018 à 16:18, 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">> Because generator expressions are not handled in every cmake construct:<br>
> <a href="https://cmake.org/cmake/help/v3.12/manual/cmake-generator-expressions.7.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/v3.12/manual/cmake-generator-expressions.7.html</a><br>
> <br>
> genex is probably not handled in foreach.<br>
<br>
That is a harsh limitation, set() or list() also does not expand this expression.<br></blockquote><div><br></div><div>genex are evaluated during "Generation time" i.e. when CMake produces/generates the specific build system</div><div>files (makefile, [build|rules].ninja, MSVC solution etc...). This is convenient because some (most of) genex informations</div><div>may be generator specific (library file name, build artefact location, etc...)</div><div><br></div><div><a href="https://stackoverflow.com/questions/46206495/cmake-generator-expressions">https://stackoverflow.com/questions/46206495/cmake-generator-expressions</a><br></div><div><br></div><div>set() , list(), foreach() are "running" at "CMake time" i.e. when cmake runs and processes CMakeLists.txt and other cmake scripts</div><div>that is before "Generation time".</div><div> </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 variable XYZ, when set via this indirection to TARGET_OBJECTS,<br>
<br>
add_library(lib12 SHARED $<TARGET_OBJECTS:objlib12>)<br>
get_property(XYZ TARGET lib12 PROPERTY SOURCES)<br>
<br>
is also not expanded yet. Is there a workaround regarding the generator expressions, or <br>
another way to get the TARGET_OBJECTS of an object library (and why is this hidden <br>
behind a generator and not available as a property)?<br></blockquote><div><br></div><div>My opinion (but I may be proven wrong by others) is that genex contains generator specific bits that cannot be **evaluated**</div><div>until the build system is generated. Properties (on target, or directory, or files) contains informations that is available as soon</div><div>as the corresponding CMakeLists.txt part defining the object has been processed. </div></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div></div>