[Cmake] does the GENERATED property work ?
William A. Hoffman
billlist at nycap.rr.com
Wed Sep 8 09:23:26 EDT 2004
Does this example work for you:
http://public.kitware.com/Wiki/CMake_FAQ#How_can_I_generate_a_source_file_during_the_build.3F
I did fix a bug where generated .h files did not get properly set to generated.
But that does not seem to be your case.
-Bill
At 06:36 PM 9/7/2004, Alexander Neundorf wrote:
>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
>
>_______________________________________________
>Cmake mailing list
>Cmake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake
More information about the Cmake
mailing list