[Cmake] "make install" fails on QT_WRAP_CPP moc header file

David Thompson dcthomp at sandia . gov
Tue, 07 Oct 2003 13:26:32 -0700


The following code in CMakeLists.txt will cause make to die with the
complaint that moc_qBlah.h does not exist. Of course, that file
shouldn't exist because moc_qBlah.cxx is not a class -- it's  a partial
implementation of the qBlah.h with the rest of the implementation in
qBlah.cxx. How should one specify C++ implementation files that don't
have an associated header? I didn't see any appropriate
SET_SOURCE_FILES_PROPERTIES property.

...
SET( GuiLibSrcs qBlah.cxx )
SET( GuiLibMocHeaders qBlah.h )
# Do wrap Qt header files
QT_WRAP_CPP( GuiLib GuiLibSrcs GuiLibMocHeaders )
SET_SOURCE_FILES_PROPERTIES( ${GuiLibSrcs} GENERATED )
# Don't wrap in Tcl/Python
SET_SOURCE_FILES_PROPERTIES( ${GuiLibSrcs} WRAP_EXCLUDE )
SET( Gui_SRCS ${Gui_SRCS} ${GuiLibSrcs} )
ADD_LIBRARY( Gui ${Gui_SRCS} )
INSTALL_FILES ( /include/Gui .h ${Gui_SRCS} )
...

		Thanks,
		David