Working on
premake-codeBlocks and
premake-qt to generate Code::Blocks project with Qt, I encountered issues with generated source files.
I have 3 different source files type, expected generation is:
resources.qrc -> resources.cpp (-> resources.o) OK
foo.ui -> ui_foo.h (OK too)
foo.h -> moc_foo.cpp (-> moc_foo.o)
I used respectively (path simplified (tool options and complete path for bin&obj omitted)):
<Option compile="1" />
<Option link="1" />
<Option weight="40" />
<Option compiler="gcc" use="1" buildCommand="qrc resource.qrc -o resource.cpp\n$compiler $options $includes -c resource.cpp -o $object" />
<Option compile="1" />
<Option weight="35" />
<Option compiler="gcc" use="1" buildCommand="uic foo.ui -o ui_foo.h" />
<Option compile="1" />
<Option link="1" />
<Option weight="40" />
<Option compiler="gcc" use="1" buildCommand="moc foo.h -o moc_foo.cpp\n$compiler $options $includes -c moc_foo.cpp -o $object" />
Issue for the last one with `$object` which is `foo.h.gch` for `foo.h`whereas I expect `moc_foo.o` (or any unique .o, `foo.o` would also be problematic as foo.cpp also exists).
I tried to replace directly `$object` by `moc_foo.o`, but then the link fails.
Is there a way to specify object (it is shown in UI, but as read only) or fix the issue differently?
(I previously added generated file directly in project, but build failed as the file doesn't exist at the begining of the build).