I'm trying to use Code::Blocks to build QT projects.
Not really a problem.
In all header files that use signal / slot / QObject, I right clic on file,
- in Build tab I check
Compile File and put the priority level to 10 (compile before the other files).
- In Advanced tab I check
use custom command to build this file and I put the code :
"$(#qtdir)\bin\moc.exe" "$file" -o ".\GeneratedFiles\$(ConfigurationName)\moc_$file_name.cpp"
Where $(ConfigurationName) is a project custom variable that is "Debug" or "Release".
All is working fine exept a warning :
warning: missing whitespace after the macro name [enabled by default]
The problem is :
-> In Visual C++ when making custom build, you are allowed to indicate to compiler what file will be generated while compiling this file. In my case, indicate it generate
.\GeneratedFiles\$(ConfigurationName)\moc_$file_name.cpp.
-> In Code::Blocks you cannot indicate what kind of file the build will generate.
So, when modifying the generated or source file, the compiler know that the file must be re-build (in Visual C++)
In Code::Blocks, it doesn't know that, so, even the file hase no modification the build is always run, the file re-build and all dependencies re-build again, making for a large projet a long compilation time each time the build process is executed!
Do you have an idea ?