Hi!

> Add to your module.cpp:
> 
> #include "moc_module.cpp"
> 
> This is recommended anyway, regardless of your problem. Always #include the 
> module output for your headers in your corresponding .cpp files.

I tried a variant of the above using C++17 __has_include:

   #if __has_include("moc_module.cpp")
      #include "moc_module.cpp"
   #endif

My goal was easier module maintenance by automatic inclusion of moc-code in 
case moc found
relevant code in the header. Especially after reworking a module this can be 
easily
forgotten without the above.

Then I get this error: 

   No rule to make target 'moc_module.cpp', needed by 'core_module.o'.  Stop.

I also tried this:

   #if 0
      #include "moc_module.cpp"
   #endif

Same error.

It appears to me that qmake is looking for "#include "moc_module.cpp"" using 
some simple
regular expression which does not take any conditional compilation into 
account. Is this
correct?

-- 
Best Regards,
Bernhard Lindner

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to