diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91b72e59af..0b445de9f1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -708,6 +708,18 @@ else()
   OCCT_CHECK_AND_UNSET ("3RDPARTY_FLEX_EXECUTABLE")
 endif()
 
+# qt for inspector and samples
+if (BUILD_Inspector OR BUILD_SAMPLES_QT)
+  # check qt 3rdparty path
+  add_definitions (-DHAVE_QT)
+  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
+  message (STATUS "Info: Qt is used by OCCT")
+else()
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_QT")
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TQTMALLOC")
+  OCCT_CHECK_AND_UNSET ("INSTALL_QT")
+endif()
+
 # check all 3rdparty include paths
 string (REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}")
 if (3RDPARTY_NOT_INCLUDED)
@@ -795,17 +807,6 @@ else()
   set (SCRIPT_EXT sh)
 endif()
 
-if (BUILD_Inspector OR BUILD_SAMPLES_QT)
-  # check qt 3rdparty path
-  add_definitions (-DHAVE_QT)
-  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
-  message (STATUS "Info: Qt is used by OCCT")
-else()
-  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_QT")
-  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TQTMALLOC")
-  OCCT_CHECK_AND_UNSET ("INSTALL_QT")
-endif()
-
 # OCCT tools
 # include the patched or original list of tools
 # list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
diff --git a/adm/cmake/qt.cmake b/adm/cmake/qt.cmake
index 01546ce106..6958bab562 100644
--- a/adm/cmake/qt.cmake
+++ b/adm/cmake/qt.cmake
@@ -1,23 +1,21 @@
 #qt
 
-#looking for 3RDPARTY_QT_DIR variable used later in qt_macro.cmake
-SET(CSF_QtCore "QtCore")
-THIRDPARTY_PRODUCT("QT" "" "CSF_QtCore" "d")
+# Qt is searched manually first (just determine root)
+message (STATUS "Processing Qt 3-rd party")
 
-list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin")
+if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "")
+  FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME)
 
-list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_INCLUDE_DIR")
-list (REMOVE_ITEM 3RDPARTY_NO_LIBS "3RDPARTY_QT_LIBRARY_DIR")
-list (REMOVE_ITEM 3RDPARTY_NO_DLLS "3RDPARTY_QT_DLL_DIR")
+  if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "")
+    message (FATAL_ERROR "... Qt root directory was not found")
+  endif()
 
-UNSET (${3RDPARTY_QT_DLL} CACHE)
-UNSET (${3RDPARTY_QT_DLL_DIR} CACHE)
-UNSET (${3RDPARTY_QT_INCLUDE_DIR} CACHE)
-UNSET (${3RDPARTY_QT_LIBRARY} CACHE)
-UNSET (${3RDPARTY_QT_LIBRARY_DIR} CACHE)
+  # Combine directory name with absolute path and show in GUI
+  set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
+  message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
+endif()
 
 set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
-message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
 
 # Now set CMAKE_PREFIX_PATH to point to local Qt installation.
 # Without this setting find_package() will not work
@@ -33,4 +31,4 @@ if (NOT ${Qt5_FOUND})
   #message (STATUS "Qt4 cmake configuration")
 else()
   #message (STATUS "Qt5 cmake configuration")
-endif()
+endif()
\ No newline at end of file