diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index e7d25c9..1cac917 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -65,6 +65,11 @@ # is much more flexible, but requires that FindQt4.cmake is executed before # such an exported dependency file is processed. # +# QT_INCLUDE_AS_SYSTEM_HEADERS +# If this variable is set to TRUE, the Qt header files will be included as +# system headers if the compiler supports it, ignoring most warnings +# occuring in them. +# # There are also some files that need processing by some Qt tools such as moc # and uic. Listed below are macros that may be used to process those files. # diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake index e8166f4..53b5cf6 100644 --- a/Modules/UseQt4.cmake +++ b/Modules/UseQt4.cmake @@ -89,7 +89,11 @@ foreach(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN if(QT_USE_${module}) string(REPLACE "QT" "" qt_module_def "${module}") add_definitions(-DQT_${qt_module_def}_LIB) - include_directories(${QT_${module}_INCLUDE_DIR}) + if(QT_INCLUDE_AS_SYSTEM_HEADERS) + include_directories(SYSTEM ${QT_${module}_INCLUDE_DIR}) + else() + include_directories(${QT_${module}_INCLUDE_DIR}) + endif() endif() set(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY}) set(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS})