<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Le jeu. 4 oct. 2018 à 16:53, Björn Blissing <<a href="mailto:bjorn.blissing@vti.se">bjorn.blissing@vti.se</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="SV" link="blue" vlink="purple">
<div class="m_3027595708388064836WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello Eric,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">The minimal example was just to display the expansion error. In real life the code uses a Boolean variable (and the
</span><span lang="EN-US">rest of the CMake code is much larger as well).</span> </p></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="SV" link="blue" vlink="purple"><div class="m_3027595708388064836WordSection1"><p class="MsoNormal"><span lang="EN-US">It was just to show the expansion error you get if you try to use a conditional generator expression inside a target_link_libraries function.</span></p></div></div></blockquote><div><br></div><div>Sometimes the devil is hiding in the details.</div><div>Do ou manage to reproduce the genex expansion error on a toy example?</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="SV" link="blue" vlink="purple"><div class="m_3027595708388064836WordSection1">
<p class="MsoNormal"><span lang="EN-US">I do agree that using it would be simpler if I could use:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> $<$<CONFIG:Debug>:${MYLIBS_DEBUG}><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> $<$<CONFIG:Release>:${MYLIBS_OPTIMIZED}><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">But since I use a third party find module the MYLIB_LIBRARIES variable is not separated into these categories. I was hoping to avoid rewriting this external find module.</span></p></div></div></blockquote><div><br></div><div>You can perfectly write a CMake helper function which takes MYLIB_LIBRARIES as input and spit out MYLIBS_DEBUG, MYLIBS_OPTIMIZED as an output.</div><div>This way you don't have to rewrite 3rd party code and keep your code clean.</div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div></div>