I have made a call to qt4_wrap_cpp(moc_outfiles ${moc_header}) and I want the results of that call (moc_outfiles) to be placed in a folder called GeneratedFiles/Debug.
So far what I tried to make my own custom method that failed due to parsing error Parse error. Expected "(", got quoted argument with text "${it}".
FOREACH (it ${moc_headers})
QT_MOC_EXECUTABLE ${it} -o ./GeneratedFiles/Debug/moc_"${it}"
ENDFOREACH(it)
It looks like you need the
execute_processcommand. Also, you probably don’t want the quotes round${it}in your output filename:You may need to add the
WORKING_DIRECTORYargument too – I’m unfamiliar with Qt’s moc exe.