automoc

Hi

I have a question about qt signals in header file. In documentaion to cmake i read which file will be proccessed by auo-moc:

"For all C++ source files <source_base>.<source_extension> in the target’s sources, CMake searches for

  • a regular header with the same base name (<source_base>.<header_extention>)"

Am I correct that two files, source and header must be in same directory.

I think if you don’t explicitly list headers, I imagine so. Having automoc search all over the place for a header doesn’t sound wise. If you add the headers to the target source list, that should also work (since removing the extension and adding a header extension would make the same path).

It’s way a to add whole directory instead of listong all files?

Yes, but I don’t recommend it in practice.