Other pb with cmake

Alexander Neundorf neundorf at kde.org
Thu Mar 16 19:08:18 CET 2006


On Thursday 16 March 2006 18:59, you wrote:
> Laurent Montel wrote:
> > Hi,
> > I use snapshot from yesterday and I have this error:
> > kdegames:
> > kdegames/CMakeLists.txt :
> > set(libksirtetbase_SRCS
> >     ${CMAKE_SOURCE_DIR}/libksirtet/base/kzoommainwindow.cpp
> >     ${CMAKE_SOURCE_DIR}/libksirtet/base/main.cpp
> >     ${CMAKE_SOURCE_DIR}/libksirtet/base/field.cpp
> >     ${CMAKE_SOURCE_DIR}/libksirtet/base/piece.cpp
> >     ${CMAKE_SOURCE_DIR}/libksirtet/base/highscores.cpp
> >     ${CMAKE_SOURCE_DIR}/libksirtet/base/factory.cpp
> >     ${CMAKE_SOURCE_DIR}/libksirtet/base/gtetris.cpp
> >     ${CMAKE_SOURCE_DIR}/libksirtet/base/board.cpp
> >     ${CMAKE_SOURCE_DIR}/libksirtet/base/settings.cpp
> >     ${CMAKE_SOURCE_DIR}/libksirtet/base/inter.cpp
> > )
> >
> > kdegames/klickety/CMakeList.txt
> > set(klickety_SRCS ${libksirtetbase_SRCS}
> >    piece.cpp
> >    board.cpp
> >    field.cpp
> >    highscores.cpp
> >    main.cpp )
> >
> > And I am this error:
> > CMake Error: Attempt to add a custom rule to output
> > "/home/lmontel/kde-4.0/kde4/cmake/snapshot/kdegames/klickety/board.moc"
> > which already has a custom rule.
> > CMake Error: Attempt to add a custom rule to output
> > "/home/lmontel/kde-4.0/kde4/cmake/snapshot/kdegames/klickety/main.moc"
> > which already has a custom rule.
> >
> > So he will want to generate two file.moc with same name in same
> > directory. Perhaps we must generate them into own directory.
>
> I suspect this is a problem with the kde macros used to create the
> custom commands for moc-ing.  Alex?

They create the moc files in CMAKE_CURRENT_BINARY_DIR .
If a source files includes:
"#include <myname.moc>" automatically a rule for creating this moc file will 
be created.
This would result in two moc files with the same name in the same directory. 
This doesn't work. 

Options:
-create the moc files in the subdirs where the object file will be located 
 This directory is currently not part of the include path, so it probably 
wouldn't be found
-don't use automoc for the duplicate files and moc them extra
-rename the files so that the moc file names won't conflict
-anything else ?

Bye
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net


More information about the Kde-buildsystem mailing list