[CMake] QT_WRAP_CPP issue -- help!

Brad King brad.king at kitware.com
Wed Nov 9 10:43:53 EST 2005


Amit Ramesh wrote:
> OUR_MACRO_MAKE_LIB () 
> 
> #
> # MACRO (OUR_MACRO_MAKE_LIB)
> #
> # QT_WRAP_CPP (${PROJECT_NAME} MOC_FILES ${MOC_HEADERS})
> # ADD_LIBRARY (${PROJECT_NAME} STATIC ${SRCS} ${MOC_FILES})
> #
> # ENDMACRO (OUR_MACRO_MAKE_LIB)
> 
> ---------------------------------------------
> 
>     I get the following error on compiling the non-working version with 
> CMake (2.2):
> 
> CMake Error: Attempt to add a custom rule to output "moc_a.cxx" which 
> already has a custom rule.
> CMake Error: Attempt to add a custom rule to output "moc_b.cxx" which 
> already has a custom rule.

It looks like the macro is causing multiple invocations of QT_WRAP_CPP. 
     If you build CMake from source you can add some debugging 
statements to Source/cmQTWrapCPPCommand.cxx.

-Brad


More information about the CMake mailing list