The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=13995 ====================================================================== Reported By: Yichao Yu Assigned To: ====================================================================== Project: CMake Issue ID: 13995 Category: CMake Reproducibility: always Severity: major Priority: urgent Status: new ====================================================================== Date Submitted: 2013-03-09 00:42 EST Last Modified: 2013-03-09 00:42 EST ====================================================================== Summary: Builtin automoc doesn't automatically include system include path. Description: When qt is not installed in /usr/include (e.g. installed in /usr/include/qt4 instead), which is the default system include dir, the moc command line generated by builtin automoc doesn't have -I/usr/include argument, even if it has been explicitly added as include dir by include_directories, causing moc not able to find headers installed in the system include dir. Since this is the path the compiler will search anyway (unless using some special switch to turn off maybe?), moc should also search in this(these) path(s), especially when a dependency library has headers installed in it and therefore had added it explicitly.
Since moc may has no idea what exactly the system include dir is (it's not gcc anyway) not to mention whether it has been explicitly added using include_directories in cmake, while cmake has access to these info, cmake should pass these dir as command line arguments (may put them at the end though). Steps to Reproduce: 1. Install qt's header in /usr/include/qt4 (so that qt4' qmake -query QT_INSTALL_HEADERS gives /usr/include/qt4) (just as what is done in archlinux's package). 2. Install phonon from git, which has headers installed in /usr/include/phonon and require /usr/include to be in the include path and also uses cmake's builtin automoc for newer cmake in it's git version. 3. Try compiling phonon-vlc from git, using make VERBOSE=1, error will be reported causing by not being able to find the definition of an interface which is actually defined in one of the headers in /usr/include/phonon (which is actually included by that header using #include <phonon/**.h>), the command line shows that -I/usr/include is not in the command line argument and strace the command line also shows the correct path is not searched. Adding -I/usr/include to command line argument works well. Additional Information: the automoc package works perfect. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2013-03-09 00:42 Yichao Yu New Issue ====================================================================== -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers