summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutomoc.cxx
Commit message (Collapse)AuthorAgeFilesLines
* automoc: use the header extensions from cmMakefileAlex Neundorf2013-02-101-23/+9
| | | | | | | Instead of having an own set of C header extensions, use cmMakefile::GetHeaderExtensions() (#13904) Alex
* automoc: use a std::vector<> instead a std::listAlex Neundorf2013-02-101-11/+12
| | | | Alex
* Process COMPILE_DEFINITIONS as generator expressions in QtAutomoc.Stephen Kelly2013-01-291-1/+5
| | | | Fixes #13493.
* Automoc: get include dirs without stripping implicit include dirs offAlex Neundorf2012-12-071-59/+3
| | | | | | | | | This should finally fix #13667 and #13762. Instead of adding special handling to guess whether implicit include dirs may have been removed, simply make it possible to query the include dirs without removing the implicit ones. Alex
* Merge topic 'FixAutomocRegression3'Brad King2012-11-201-0/+59
|\ | | | | | | | | d253657 Automoc: fix regression #13667, broken build in phonon
| * Automoc: fix regression #13667, broken build in phononAlex Neundorf2012-11-201-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some systems, ${QT_INCLUDE_DIR} is reported by gcc as a builtin include search dir. Some projects use this information to extend CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES. In cmake 2.8.10 now the targets are queried for the include directories they use. When they return the result, the include dirs contained in CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES have been removed. In cmake 2.8.9 and below the INCLUDE_DIRECTORIES directory property was queried, where this had not been stripped. So, in those projects which modify the implicit include dirs variable, on systems where ${QT_INCLUDE_DIR} is reported by gcc, this directory, e.g. /usr/lib/include/qt/, was not given anymore to moc. This made moc not find required headers, so the build broke. Simply giving the full CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES to moc is no solution either, since moc can't handle some of the headers it finds then (https://bugreports.qt-project.org/browse/QTBUG-28045). So now cmake checks CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES, and if this contains ${QT_INCLUDE_DIR}, and the target reports that it uses ${QT_QTCORE_INCLUDE_DIR} but not ${QT_INCLUDE_DIR}, ${QT_INCLUDE_DIR} is added to the include dirs given to moc. Alex
* | Automoc: "inherit" FOLDER target property from target (#13688)Alex Neundorf2012-11-171-1/+17
|/ | | | | | | | | | This patch sets the FOLDER target property for the automoc target to the same value as of the actual target. This organizes the targets in IDEs with folders better. Inspired-by: Mike Gelfand Alex
* Automoc: fix #13572: issue with symbolic linksAlex Neundorf2012-10-141-1/+2
| | | | | | | | | Now automoc always uses GetRealPath() so symbolic links are always resolved and it doesn't end up with twice the same file, once with the real path and once with the symlinked path in some setups where the source dir can be accessed directly and via a symlink Alex
* Use the cmGeneratorTarget for the include directories API.Stephen Kelly2012-09-191-2/+3
| | | | | Also, no need to get the include directories from the target beforehand. The local generator does that for us anyway.
* Automoc: also the makefile-COMPILE_DEFINITIONSAlex Neundorf2012-09-061-0/+6
| | | | Alex
* Automoc: do not use DEFINITIONS, but only COMPILE_DEFINITIONSAlex Neundorf2012-09-051-32/+6
| | | | | | | The docs say that this is for cmake 2.4 backwards compatibility only, so we probably don't need to support it. Alex
* Automoc: fix #13493, use target properties for include dirsAlex Neundorf2012-09-051-4/+16
| | | | Alex
* fix #13494: rerun automoc also if include dirs or moc options changeAlex Neundorf2012-08-271-5/+24
| | | | | | | | Until now it was only rerun if the compile definitions changed, but of course it also has to rerun if the include dirs or moc options change. Strange that I didn't notice this before... Alex
* automoc: better error handling (#13299)Alex Neundorf2012-06-141-3/+4
| | | | | | | automoc now fails immediately if moc fails, instead of continuing and letting the build fail later on. Alex
* Avoid direct use of std::(o|)stringstream (#13272)Brad King2012-06-121-2/+3
| | | | | | | | | Older C++ compilers do not provide a standard std::stringstream. Use our compatibility interfaces instead. Also avoid std::stringstream(openmode) signature. Our approximate stringstream implementation provided when the standard one is not available does not support the openmode argument.
* automoc: include <unistd.h> on Apple to get pathconfSean McBride2012-03-281-0/+3
|
* automoc: fix #13018, proper cmake escaping to avoid false rebuildsAlex Neundorf2012-03-261-9/+17
| | | | | | | | | | The variables stored in the AutomocInfo.cmake file were not properly escaped, so when reading them back they could turn into lists, if they contained double quotes initially. This patch fixes this by using cmLocalGenerator::EscapeForCMake() to escape the variables properly. Alex
* automoc: improved warning message in relaxed modeAlex Neundorf2011-12-141-5/+8
| | | | Alex
* automoc: default to strict mode, use CMAKE_AUTOMOC_RELAXED_MODEAlex Neundorf2011-12-131-8/+4
| | | | | | | | | automoc now defaults to strict mode, also with Qt4, i.e. it behaves as the documentation says by default. I also inverted the switch CMAKE_AUTOMOC_STRICT_MODE to CMAKE_AUTOMOC_RELAXED_MODE. Docs and test adapted accordingly. Alex
* Merge branch 'master' into AutomocIncludedDotMocFileHandlingDavid Cole2011-12-071-10/+35
|\ | | | | | | | | Conflicts: Source/cmTarget.cxx
| * moc is now part of the Qt5Core moduleStephen Kelly2011-11-261-3/+3
| | | | | | | | There is no separate SrcTools module anymore.
| * Merge remote-tracking branch 'origin/master' into automoc_qt5Stephen Kelly2011-11-101-5/+21
| |\
| | * Merge topic 'FixAutomocFromCCMakeFromPATH'David Cole2011-11-081-1/+1
| | |\ | | | | | | | | | | | | | | | | 83d02ee make automoc work when using ccmake via PATH (#12551)
| | | * make automoc work when using ccmake via PATH (#12551)Alex Neundorf2011-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In ccmake, cmake::GetCMakeCommand() returns "/cmake" when ccmake was started from the PATH, i.e. by simply running "ccmake" Alex
| | * | Merge topic 'AddMocOptionsToAutomoc'David Cole2011-11-081-0/+12
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | 2c648ab add documentation for the AUTOMOC_MOC_OPTIONS property 52719a1 automoc: fix #12541, support moc options
| | | * | automoc: fix #12541, support moc optionsAlex Neundorf2011-11-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a new target property AUTOMOC_MOC_OPTIONS, which can be set to add extra options for the moc invocations done via automoc. This is equivalent to the OPTIONS parameter in the qt4_wrap_cpp() macro. Alex
| | * | | Merge topic 'DontCrashAutomocWithEmptyCompileDefs'David Cole2011-11-081-4/+8
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | | | | | | 1ecc55a Automoc: fix the fix, need to use std::string, not just char* pointer 8c8305f don't crash in automoc with empty COMPILE_DEFINITIONS property
| | | * | Automoc: fix the fix, need to use std::string, not just char* pointerAlex Neundorf2011-11-011-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to take a copy of the property values, since the returned char* pointer is reused by the following GetProperty() calls Alex
| | | * | don't crash in automoc with empty COMPILE_DEFINITIONS propertyAlex Neundorf2011-10-311-7/+8
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | Reported by Laszlo Papp: http://www.cmake.org/pipermail/cmake/2011-October/047089.html Alex
| * | | Fix style.Stephen Kelly2011-11-091-2/+3
| | | |
| * | | Update comments and method names to not be Qt4 specific.Stephen Kelly2011-11-091-3/+3
| | | |
| * | | Don't assume the existence of QT_MAJOR_VERSION.Stephen Kelly2011-11-091-0/+8
| |/ / | | | | | | | | | Also handle Qt5SrcTools_MAJOR_VERSION.
| * | Also run moc automatically with Qt5.Stephen Kelly2011-11-011-2/+2
| |/ | | | | | | The method of running moc hasn't changed in Qt5.
* | automoc: fix line lengthAlex Neundorf2011-12-061-1/+1
| | | | | | | | Alex
* | automoc: add variable CMAKE_AUTOMOC_STRICT_MODE, to enable strict parsingAlex Neundorf2011-12-021-2/+11
| | | | | | | | Alex
* | automoc: accept even more .moc files in non-strict modeAlex Neundorf2011-12-021-56/+25
| | | | | | | | Alex
* | automoc: also accept other files when .moc is included in non-strict modeAlex Neundorf2011-12-021-20/+14
| | | | | | | | Alex
* | automoc: add a StrictParseCppFile(), which is only qmake-compatibleAlex Neundorf2011-12-021-6/+122
| | | | | | | | | | | | | | | | ParseCppFile() is the one which is automoc4/KDE4-compatible, and which becomes a bit crowded. By separating these two it is easier to ensure that the strict one doesn't get broken accidentially. Alex
* | automoc: move the code for finding headers into separate functionAlex Neundorf2011-12-021-19/+31
| | | | | | | | Alex
* | automoc: fix handling of included _p.moc filesAlex Neundorf2011-11-301-2/+3
| | | | | | | | Alex
* | automoc: some more linebreaks for the warnings for better readabilityAlex Neundorf2011-11-291-8/+8
| | | | | | | | Alex
* | automoc: add extra check whether the header contains Q_PRIVATE_SLOTAlex Neundorf2011-11-291-1/+50
| | | | | | | | | | | | | | | | | | | | | | This is again for KDE4 compatiblity. If foo.moc is included, in general moc should run on foo.cpp. Usually this can't cause problems. It can only cause problems if moc must run on the header, and the resulting file must be included in the cpp file, which is the case with the Q_PRIVATE_SLOT macro. This makes the test added by Stephen pass. Alex
* | automoc: add special handling for including basename_p.moc, with testAlex Neundorf2011-11-221-7/+32
| | | | | | | | Alex
* | automoc: move some code from the big parsing loop into separate functionsAlex Neundorf2011-11-221-30/+47
| | | | | | | | Alex
* | Automoc: modified handling of included .moc filesAlex Neundorf2011-11-161-3/+14
| | | | | | | | | | | | | | | | -enable the KDE4-compatiblity mode only when using Qt4 -always (except in the KDE4 compat mode) error out if a cpp-file contains "Q_OBJECT", but does not include filename.moc Alex
* | automoc: another runtime optimizationAlex Neundorf2011-11-101-6/+23
| | | | | | | | | | | | | | before doing the full regexp, try a simple strstr(), if this already fails, no need to do the regexp matching. Alex
* | automoc: minor optimizationAlex Neundorf2011-11-101-1/+1
| | | | | | | | | | | | | | | | Handing th std::string instead the char* to the find() reduces the time from 17 to 15 seconds (for a 1000 times loop of a relatively small file), which is around 10 percent. Alex
* | automoc: improved diagnosticsAlex Neundorf2011-11-101-10/+11
| | | | | | | | | | | | | | Error/warning messages now look like: AUTOMOC: (error|warning): <filename>: the actual text... Alex
* | automoc: handle the case when the developer includes the wrong mocfileAlex Neundorf2011-11-101-0/+33
| | | | | | | | | | | | | | | | | | | | There are multiple/many places in KDE where the developer includes moc_foo.cpp, and expects moc to run on foo.cpp, instead of foo.h. He should use foo.moc, but right now this is handled by automoc4, so we must stay compatible. So support this too, but warn about it. Alex
* | automoc: rework the checking for the matching header, to give better warningsAlex Neundorf2011-11-101-42/+35
| | | | | | | | Alex