Re: Other pb with cmake
On Friday 17 March 2006 18:17, Laurent Montel wrote: On Friday 17 March 2006 17:28, Alexander Neundorf wrote: ... In order for the preprocessor to find build/lib/board.moc, build/lib/ would have to be added to the include path, just as build/ is part of the include path. This would mean *both* directories would be in the include path and for both files, src/board.cpp and src/lib/board.cpp the include path would be the same, so for both source files the *same* board.moc would be found first, so both would include build/board.moc. So I think we really have to change the moc handling for these conflicting files, i.e. automoc for on of them, and manual moc for the others, like this: set_source_files_properties(src/lib/board.cpp ...more files PROPERTIES SKIP_AUTOMOC TRUE) qt4_wrap_cpp(MY_SRCS src/lib/board.h ...more files which need to be mocced) Where is the difference ? we will generate .moc too. we will link with src/lib/board.moc and src/board.moc But the command line has to include -Ibuild/ -Ibuild/lib/, and this for both files, and so the preprocessor will find the same board.moc for both source files. So how your method will fix potential problem ? It will generate a src/board.moc (which will be included) and a src/lib/moc_board.cxx (which will be compiled as a separate file). 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 ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: Other pb with cmake
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 ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: Other pb with cmake
On Thursday 16 March 2006 19:08, Alexander Neundorf wrote: -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 Right, that's what I did and then reverted because of the include path problem. However it still sounds like the right solution to me. Ideally we could automate this include path stuff. (Adding srcdir/subdir and builddir/subdir when compiling a file from subdir... or when compiling all the files from srcdir...) But wait, won't the .o end up in the same directory, too, currently? -- David Faure, [EMAIL PROTECTED], sponsored by Trolltech to work on KDE, Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org). ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem
Re: Other pb with cmake
David Faure wrote: On Thursday 16 March 2006 19:08, Alexander Neundorf wrote: -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 Right, that's what I did and then reverted because of the include path problem. However it still sounds like the right solution to me. Ideally we could automate this include path stuff. (Adding srcdir/subdir and builddir/subdir when compiling a file from subdir... or when compiling all the files from srcdir...) Once we do the next KDE CMake release the auto-include-dir will work. But wait, won't the .o end up in the same directory, too, currently? No, the object file name is constructed relative to the current source or build directory so it will not conflict. -Brad ___ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem