<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 21, 2018 at 2:47 AM, Michael Jackson <span dir="ltr"><<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_-2747519772072510990WordSection1"><p class="MsoNormal"><span style="font-size:11pt">I have a project where we have a bunch of plugins that are compiled. We are currently wrapping with Pybind11 to access those libraries from Python. The issue on windows is that we get a multiple DLL load error and our thought was to create 1 enormous python module library (Not sure if this is the right idea or not….)<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt">So my question has to do with how to add files to a target that might initially get created about 3 subdirs down from the top level CMakeLists.txt file but each time cmake runs through a CMake file that would configure a plugin can we just keep adding files to the python module target through the use of target_sources() command. Not sure how that works or if that idea would work.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt">Thoughts or pointers would be very much welcome.<u></u><u></u></span></p><p class="MsoNormal"><br></p></div></div></blockquote></div><br clear="all"><div>You should be able to use target_sources() to do that, although I'd recommend you create the target higher up rather than burying it deeper down in the subdirs. It would seem more logical to create the target at the point above where all the subdirs that add sources are. Maybe have a read of the following article for a more detailed discussion of using target_sources() in this way:</div><div><br></div><div><a href="https://crascit.com/2016/01/31/enhanced-source-file-handling-with-target_sources/">https://crascit.com/2016/01/31/enhanced-source-file-handling-with-target_sources/</a><br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div></div></div></div></div></div></div>
</div></div>