KDE/kdelibs/cmake/modules
David Faure
faure at kde.org
Wed Feb 15 12:46:34 CET 2006
SVN commit 509646 by dfaure:
Reverting - generating moc files in subdirs worked, but this broke compilation because
the subdir (in the builddir) is missing from the -I. How could we add it?
(E.g. kdelibs/kio/kfile/kopenwith.cpp is compiled from kdelibs/kio, so the relative path
to the header is kfile/kopenwith.h, and this created a kfile/kopenwith.moc, but it's included
as "kopenwith.moc" from kopenwith.h so we need -Ikfile in the compilation line. This is
necessary for the kabc/addressbook.h vs kabc/kab/addressbook.h case)
CCMAIL: kde-buildsystem at kde.org
M +2 -4 KDE4Macros.cmake
--- trunk/KDE/kdelibs/cmake/modules/KDE4Macros.cmake #509645:509646
@@ -242,11 +242,9 @@
STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE)
+# set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
set(_header ${_abs_PATH}/${_basename}.h)
- # Determine relative path to the header, so that foo/bar.h becomes foo/bar.moc
- file(RELATIVE_PATH _relative_path ${CMAKE_CURRENT_SOURCE_DIR} ${_abs_PATH})
- set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_relative_path}/${_current_MOC})
- #
+ set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
ADD_CUSTOM_COMMAND(OUTPUT ${_moc}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS ${_moc_INCS} ${_header} -o ${_moc}
More information about the Kde-buildsystem
mailing list