From 7a1027a1b6d1544bae9329f42c0872a551859572 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Thu, 3 Feb 2011 16:37:04 -0700 Subject: [PATCH] When checking find_package() components, special case qtmain. Its just a library on Windows only. Fixes bug #11791. --- Modules/FindQt4.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index ec04cd23d7..31fa43c014 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1112,7 +1112,13 @@ IF( Qt4_FIND_COMPONENTS ) SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR) FOREACH( component ${Qt4_FIND_COMPONENTS} ) STRING( TOUPPER ${component} _COMPONENT ) - SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY) + if(${_COMPONENT} STREQUAL "QTMAIN") + IF(Q_WS_WIN) + SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_LIBRARY) + ENDIF(Q_WS_WIN) + else(${_COMPONENT} STREQUAL "QTMAIN") + SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY) + endif(${_COMPONENT} STREQUAL "QTMAIN") ENDFOREACH( component ) if(Qt4_FIND_COMPONENTS MATCHES QtGui)