File tree 1 file changed +16
-3
lines changed
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,26 @@ if (NOT ${Qt5_FOUND})
31
31
# Now we can apply standard CMake finder for Qt. We do this mostly
32
32
# to have qt4_wrap_cpp() function available
33
33
find_package (Qt4)
34
- else ()
35
- set (3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
34
+ elseif (NOT ${USE_QT_FROM_3RDPARTY_DIR} AND WIN32 )
35
+ # Qt5_DIR typically points to lib/cmake/Qt5, need to go up to Qt root
36
+ get_filename_component (QT_CMAKE_DIR "${Qt5_DIR} " DIRECTORY )
37
+ get_filename_component (QT_LIB_DIR "${QT_CMAKE_DIR} " DIRECTORY )
38
+ get_filename_component (QT_ROOT_DIR "${QT_LIB_DIR} " DIRECTORY )
39
+
40
+ # Verify this is indeed the Qt root by checking for bin and packages directories
41
+ if (EXISTS "${QT_ROOT_DIR} /bin" )
42
+ set (3RDPARTY_QT_DIR ${QT_ROOT_DIR} CACHE PATH "The directory containing Qt" FORCE)
43
+ else ()
44
+ message (WARNING "Found Qt5 at ${Qt5_DIR} but could not determine Qt root directory with bin/ and plugins/ folders" )
45
+ set (3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
46
+ endif ()
47
+ elseif (NOT ${USE_QT_FROM_3RDPARTY_DIR} )
48
+ set (3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
36
49
endif ()
37
50
38
51
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR} " )
39
52
40
- if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR} " )
53
+ if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR} /bin " )
41
54
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR} /bin" )
42
55
else ()
43
56
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_QT_DLL_DIR)
You can’t perform that action at this time.
0 commit comments