[Cmake] does the GENERATED property work ?

Alexander Neundorf a.neundorf-work at gmx.net
Tue Sep 7 18:36:49 EDT 2004


Hi, 
 
...I'm still trying to cross-compile Qt4... 
 
Well, here is what I do with Qt headers containing signals or slots: 
 
MACRO(QT4_ADD_MOC_H_FILES _the_MOC_SRCS) 
   FOREACH (_current_FILE ${ARGN}) 
      GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE) 
      GET_FILENAME_COMPONENT(_path ${_current_FILE} PATH) 
      SET(_moc ${_path}/${_basename}_moc.cpp) 
 
   ADD_CUSTOM_COMMAND(OUTPUT ${_moc} 
      COMMAND ${_MOC4} 
      ARGS ${_header} -o ${_moc} 
      DEPENDS ${_header} 
   )                 
   SET(${_the_MOC_SRCS} ${${_the_MOC_SRCS}} ${_moc}) 
   ENDFOREACH (_current_FILE) 
ENDMACRO(QT4_ADD_MOC_H_FILES) 
 
QT4_ADD_MOC_H_FILES(the_sources ${qt4_moc_h_SRCS}) 
 
whereas the_sources is a list already containing source files and 
qt4_moc_h_SRCS is a list of header files which need to be processed by 
moc. Everything seems to work fine, except that cmake complains that 
qthread_moc.cpp doesn't exist (this is the first file in the list of 
headers). The docs say that ADD_CUSTOM_COMMAND automatically sets the 
GENERATED property to true. 
But when cmSourceFile::SetName() is called for qthread_moc.cpp the 
GENERATED property is 0. Probably SetName() shouldn't be called for this 
file at all ? 
 
Any ideas ? 
 
(I know that there are the Qt-commands in cmake, but I'd like to do it 
this way) 
 
Bye 
Alex 
 

-- 
Supergünstige DSL-Tarife + WLAN-Router für 0,- EUR*
Jetzt zu GMX wechseln und sparen http://www.gmx.net/de/go/dsl



More information about the Cmake mailing list