0

I am developing a plugin for Maya which comes with its own custom version of Qt library (including the moc). I downloaded the exact Qt version Maya uses and tried the following:

set(CMAKE_AUTOMOC ON)
find_package(Qt5Widgets)

Now this works but only partially. The plugin causes Maya to crash randomly due to (I am assuming) subtle differences in Maya's custom Qt library vs. the official Qt library - even though I have made sure I match the the Qt version numbers.

My question then is, can I somehow get CMAKE_AUTOMOC to use the moc.exe (and others) that ships with Maya instead of Qt's own?

Or to phrase the question more generically, can I get CMAKE_AUTOMOC to work with a customized version of Qt and its moc?

rocambille
  • 15,398
  • 12
  • 50
  • 68
Samaursa
  • 16,527
  • 21
  • 89
  • 160
  • What makes you think the problem is related to `CMAKE_AUTOMOC`? – rocambille Nov 07 '16 at 08:14
  • Before blaming others, how do you know the problem is not within your code? Have run Valgrind, GDB and AddressSanitizer? – usr1234567 Nov 07 '16 at 09:21
  • 1
    @usr1234567 because the crash only happens when I have this code: ` m_button = new QPushButton("MyButton"); delete m_button; ` if I remove the `delete`, then everything's fine. I have read on this issue elsewhere that `Maya` is running a modified version of the `Qt` library and subtle differences in the binaries will cause these issues. – Samaursa Nov 07 '16 at 15:29
  • @wasthishelpful I didn't say it was...? The problem is with incompatible `Qt` libraries even though they are _officially_ the same version (5.6.1). `Maya` uses a customized version of `Qt` and comes with it's own version of `moc.exe` (and other tools) - that's what I would like `CMAKE_AUTOMOC` to use. – Samaursa Nov 07 '16 at 15:30
  • 1
    @usr1234567 I am on Windows. Sadly, there is no Valgrind or Address sanitizers. However, Visual Studio's debugger confirms deleting the widget is causing heap corruption. – Samaursa Nov 07 '16 at 15:44

0 Answers0