diff options
author | Christian Pfeiffer <cpfeiffer@live.de> | 2017-11-21 10:55:20 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-11-21 10:55:40 (GMT) |
commit | 65c5833858a92dc15978f08fe2acdf852c930ee6 (patch) | |
tree | 5ac96d716d1ea0f634a325930414233eb85c43b8 /Modules | |
parent | 8f8f118327e25a3af912b504dcb3ebad5c841818 (diff) | |
parent | f81d186b156af01027e76cb8407a3ae64ad74991 (diff) | |
download | CMake-65c5833858a92dc15978f08fe2acdf852c930ee6.zip CMake-65c5833858a92dc15978f08fe2acdf852c930ee6.tar.gz CMake-65c5833858a92dc15978f08fe2acdf852c930ee6.tar.bz2 |
Merge topic 'findqt4-dirs-fix'
f81d186b FindQt4: Set PLUGINS and IMPORTS dir even if empty
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1503
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindQt4.cmake | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index c67d0be..714e4af 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -709,13 +709,19 @@ if (QT_QMAKE_EXECUTABLE AND if (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED) _qt4_query_qmake(QT_INSTALL_PLUGINS qt_plugins_dir) set(QT_PLUGINS_DIR NOTFOUND) + set(qt_cross_paths) foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH}) set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins") endforeach() - find_path(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer + find_path(QT_PLUGINS_DIR + NAMES accessible bearer codecs designer graphicssystems iconengines imageformats inputmethods qmltooling script sqldrivers HINTS ${qt_cross_paths} ${qt_plugins_dir} DOC "The location of the Qt plugins" NO_CMAKE_FIND_ROOT_PATH) + # If no plugins were installed, set QT_PLUGINS_DIR to ${qt_plugins_dir} + if(NOT QT_PLUGINS_DIR AND qt_plugins_dir) + set(QT_PLUGINS_DIR ${qt_plugins_dir} CACHE PATH "The location of the Qt plugins") + endif() endif () # ask qmake for the translations directory @@ -729,6 +735,7 @@ if (QT_QMAKE_EXECUTABLE AND _qt4_query_qmake(QT_INSTALL_IMPORTS qt_imports_dir) if(qt_imports_dir) set(QT_IMPORTS_DIR NOTFOUND) + set(qt_cross_paths) foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH}) set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/imports") endforeach() @@ -738,6 +745,10 @@ if (QT_QMAKE_EXECUTABLE AND NO_CMAKE_FIND_ROOT_PATH NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH) + # If the imports folder is empty, set QT_IMPORTS_DIR to ${qt_imports_dir} + if(NOT QT_IMPORTS_DIR AND qt_imports_dir) + set(QT_IMPORTS_DIR ${qt_imports_dir} CACHE PATH "The location of the Qt imports") + endif() mark_as_advanced(QT_IMPORTS_DIR) endif() endif () |