<p dir="ltr">Hmm, maybe...? I'm not sure. Customize may be the wrong word. What I'm asking in the question is similar to someone asking "how do I customize the output path for the binaries in CMake?". My hope was it was going to be a simple set variable for the utilities.</p>
<br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 9, 2016, 7:56 AM Jakob van Bethlehem <<a href="mailto:jsvanbethlehem@gmail.com">jsvanbethlehem@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Hej,<br class="gmail_msg"><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg">On Mon, Nov 7, 2016 at 4:48 PM, Saad Khattak <span dir="ltr" class="gmail_msg"><<a href="mailto:saadrustam@gmail.com" class="gmail_msg" target="_blank">saadrustam@gmail.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">I am working on a plugin for Maya and it uses a customized version of Qt. Maya's SDK comes with everything to build Qt (headers, libraries and customized Qt tools such as moc.exe).<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I have the following issues:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">(1) With CMAKE_AUTOMOC set to ON, I am unable to figure out how to point CMake to pick Maya's version of moc.exe (and other Qt utils). The result is that I get linking errors since the moc did not run - which I expected.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">(2) Maya uses a modified version of Qt 5.6.1. There is currently no way to get that version from Autodesk. So I downloaded the official Qt 5.6.1 distribution. CMAKE_AUTOMOC now sets up my project correctly to be MOC'ed. However, it is using the official Qt moc utilities and NOT Maya's customized moc. The headers and libraries being used were still from Maya's custom Qt.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The reason (2) worked is because I put "find_package(Qt5Widgets REQUIRED)" after installing the official version of Qt 5.6.1. However, I did NOT use the official Qt headers or libraries - instead, I used Maya's custom version of Qt 5.6.1.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Using solution (2) I successfully compile and link my Qt enabled Maya plugin and load it in Maya. Things go smoothly until I either (a) unload the plugin or (b) delete any widget. I looked at the simplest code that is causing a heap corruption debug assertion:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><span style="color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif;font-size:13px" class="gmail_msg">m_button = new QPushButton("MyButton"); // where m_button is a QPointer</span><span style="color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif" class="gmail_msg"><QPushButton></span></div><div class="gmail_msg"><span style="color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif;font-size:13px" class="gmail_msg">delete m_button; // causes heap corruption debug assertion to fire</span><br class="gmail_msg"></div><div class="gmail_msg"><span style="color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif;font-size:13px" class="gmail_msg"><br class="gmail_msg"></span></div><div class="gmail_msg"><span style="color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif;font-size:13px" class="gmail_msg">A few other people have gone through similar issues but since they didn't use CMake, they simply ran Maya's moc utilities in a build step. I would like a solution where I can get CMAKE_AUTOMOC to run the custom Qt version.</span></div><div class="gmail_msg"><span style="color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif;font-size:13px" class="gmail_msg"><br class="gmail_msg"></span></div><div class="gmail_msg"><span style="color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif;font-size:13px" class="gmail_msg">Thanks.</span></div><div class="gmail_msg"><br class="gmail_msg"></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">I see quite a lot usage of the word 'customized'..... to me it sounds like you may be asking on the wrong user list?</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Sincerely,</div><div class="gmail_msg">Jakob</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div>
</blockquote></div>