[Cmake] does the GENERATED property work ?
William A. Hoffman
billlist at nycap.rr.com
Wed Sep 8 17:00:01 EDT 2004
If you could provide a complete example that shows the problem, but
used something more like the copy used in the FAQ entry I sent, I could
take a look. (I don't have qt on my system so I can not test your code.)
Also, your cmakelist file is not complete, I would need a complete test that
showed the problem.
-Bill
At 04:47 PM 9/8/2004, Alexander Neundorf wrote:
>> 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
>
>It still doesn't work here.
>I inserted some debug output into cmake:
>
>hammer:/usr/src/xscale$ cmake .
>-- Check for working C compiler: gcc -- works
>-- Check for working CXX compiler: c++ -- works
>cmMakefile 1: name: -/home/src/xscale/firmware/qt4test/
>ecos-iq80321/../../lib/qt4/src/core/thread/qthread_moc.cpp.rule is
>generated
>cmMakefile 2: name: -/home/src/xscale/firmware/qt4test/
>ecos-iq80321/../../lib/qt4/src/core/thread/qthread_moc.cpp is generated
>
>//the two lines above come from cmMakefile::addCustomCommandToOutput(),
>where the GENERATED property is set to 1
>
>name: -/home/src/xscale/firmware/qt4test/ecos-iq80321/../main.cpp-
>generated: 0
>name: -/home/src/xscale/firmware/qt4test/ecos-iq80321/../../lib/qt4/src/
>core/global/qglobal.cpp- generated: 0
>...
>name: -/home/src/xscale/firmware/qt4test/ecos-iq80321/../../lib/qt4/src/
>core/codecs/qfontlaocodec.cpp- generated: 0
>name: -/home/src/xscale/firmware/qt4test/ecos-iq80321/../../lib/qt4/src/
>core/thread/qthread_moc.cpp- generated: 0
>
>//these lines come from cmSourceFile::SetName(), note how the path is
>exactly the same as above but the GENERATED property isn't set anymore
>(created using this->GetPropertyAsBool("GENERATED");
>
>CMake Error: can not find file /home/src/xscale/firmware/qt4test/
>ecos-iq80321/../../lib/qt4/src/core/thread/qthread_moc.cpp
>
>And finally cmake complains that it can't find the file...
>Here is my macro again, as you see now it uses absolute paths, and I
>don't build out-of-source, so CMAKE_CURRENT_SOURCE_DIR should be ok.
>
>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 ${CMAKE_CURRENT_SOURCE_DIR}/${_moc}
> COMMAND ${_MOC4}
> ARGS ${_header} -o ${CMAKE_CURRENT_SOURCE_DIR}/${_moc}
> DEPENDS ${_header}
> )
>
> SET_SOURCE_FILES_PROPERTIES(
> ${CMAKE_CURRENT_SOURCE_DIR}/${_moc}
> PROPERTIES
> GENERATED true
> )
>
> SET(${_the_MOC_SRCS} ${${_the_MOC_SRCS}} ${_moc})
>
> ENDFOREACH (_current_FILE)
>ENDMACRO(QT4_ADD_MOC_H_FILES)
>
>Any ideas ?
>
>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