FindQt4: Don't use Qt component _FOUND vars before they're defined (#14286)

This fixes a regression introduced by commit b8af46cb (FindQt4: Don't
fail if certain Qt modules are unavailable., 2013-05-23)

The _FOUND variable is set by the _QT4_ADJUST_LIB_VARS macro, so
invoke that unconditionally, and guard only the set_property calls,
as described in the original bug report (#14165).
This commit is contained in:
Stephen Kelly 2013-07-22 14:27:22 +02:00 committed by Brad King
parent b8af46cb87
commit 969e7ee5df
1 changed files with 12 additions and 18 deletions

View File

@ -881,20 +881,16 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
endforeach() endforeach()
if(Q_WS_WIN) if(Q_WS_WIN)
if (QT_QAXCONTAINER_FOUND) set(QT_MODULES ${QT_MODULES} QAxContainer)
set(QT_MODULES ${QT_MODULES} QAxContainer) # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
# Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt PATHS ${QT_HEADERS_DIR}/ActiveQt
PATHS ${QT_HEADERS_DIR}/ActiveQt NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH )
) find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt
endif() PATHS ${QT_HEADERS_DIR}/ActiveQt
if (QT_QAXSERVER_FOUND) NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt )
PATHS ${QT_HEADERS_DIR}/ActiveQt
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
)
endif()
endif() endif()
# Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
@ -1055,8 +1051,8 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
if(Q_WS_WIN) if(Q_WS_WIN)
_QT4_ADJUST_LIB_VARS(qtmain) _QT4_ADJUST_LIB_VARS(qtmain)
_QT4_ADJUST_LIB_VARS(QAxServer)
if(QT_QAXSERVER_FOUND) if(QT_QAXSERVER_FOUND)
_QT4_ADJUST_LIB_VARS(QAxServer)
set_property(TARGET Qt4::QAxServer PROPERTY set_property(TARGET Qt4::QAxServer PROPERTY
INTERFACE_QT4_NO_LINK_QTMAIN ON INTERFACE_QT4_NO_LINK_QTMAIN ON
) )
@ -1064,9 +1060,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
COMPATIBLE_INTERFACE_BOOL QT4_NO_LINK_QTMAIN) COMPATIBLE_INTERFACE_BOOL QT4_NO_LINK_QTMAIN)
endif() endif()
if(QT_QAXCONTAINER_FOUND) _QT4_ADJUST_LIB_VARS(QAxContainer)
_QT4_ADJUST_LIB_VARS(QAxContainer)
endif()
endif() endif()
# Only public dependencies are listed here. # Only public dependencies are listed here.