f9cb51
diff -Nrup a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
f9cb51
--- a/Modules/FindQt4.cmake	2014-01-16 12:15:08.000000000 -0500
f9cb51
+++ b/Modules/FindQt4.cmake	2016-02-29 18:39:54.384628635 -0500
f9cb51
@@ -886,16 +886,20 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
f9cb51
   endforeach()
f9cb51
 
f9cb51
   if(Q_WS_WIN)
f9cb51
-    set(QT_MODULES ${QT_MODULES} QAxContainer QAxServer)
f9cb51
-    # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
f9cb51
-    find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
f9cb51
-      PATHS ${QT_HEADERS_DIR}/ActiveQt
f9cb51
-      NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
f9cb51
-      )
f9cb51
-    find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt
f9cb51
-      PATHS ${QT_HEADERS_DIR}/ActiveQt
f9cb51
-      NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
f9cb51
-      )
f9cb51
+    if (QT_QAXCONTAINER_FOUND)
f9cb51
+      set(QT_MODULES ${QT_MODULES} QAxContainer)
f9cb51
+      # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
f9cb51
+      find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
f9cb51
+        PATHS ${QT_HEADERS_DIR}/ActiveQt
f9cb51
+        NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
f9cb51
+        )
f9cb51
+    endif()
f9cb51
+    if (QT_QAXSERVER_FOUND)
f9cb51
+      find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt
f9cb51
+        PATHS ${QT_HEADERS_DIR}/ActiveQt
f9cb51
+        NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
f9cb51
+        )
f9cb51
+    endif()
f9cb51
   endif()
f9cb51
 
f9cb51
   # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
f9cb51
@@ -1057,8 +1061,8 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
f9cb51
   if(Q_WS_WIN)
f9cb51
     _QT4_ADJUST_LIB_VARS(qtmain)
f9cb51
 
f9cb51
-    _QT4_ADJUST_LIB_VARS(QAxServer)
f9cb51
     if(QT_QAXSERVER_FOUND)
f9cb51
+      _QT4_ADJUST_LIB_VARS(QAxServer)
f9cb51
       set_property(TARGET Qt4::QAxServer PROPERTY
f9cb51
         INTERFACE_QT4_NO_LINK_QTMAIN ON
f9cb51
       )
f9cb51
@@ -1066,7 +1070,9 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
f9cb51
         COMPATIBLE_INTERFACE_BOOL QT4_NO_LINK_QTMAIN)
f9cb51
     endif()
f9cb51
 
f9cb51
-    _QT4_ADJUST_LIB_VARS(QAxContainer)
f9cb51
+    if(QT_QAXCONTAINER_FOUND)
f9cb51
+      _QT4_ADJUST_LIB_VARS(QAxContainer)
f9cb51
+    endif()
f9cb51
   endif()
f9cb51
 
f9cb51
   # Only public dependencies are listed here.