From dfe38f79c3aa7a1ebcf4d90792bc2a297d1b6dfa Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 3 Jun 2019 13:23:10 +0200 Subject: [PATCH] CMake build: Ensure compilation when Qt5::Script is missing The Qt5 Visual C++ 2017 64 bit installation doesn't come with Qt5::Script target by default. This patch ensures that Qt Creator can be built with the above Qt5 scenario. Change-Id: Ibe35e9d879ccd51012f53acebfbb7461fd773d4a Reviewed-by: Eike Ziller Reviewed-by: Alessandro Portale --- CMakeLists.txt | 4 ++-- src/plugins/coreplugin/CMakeLists.txt | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3a256ae9a2..353cf93d53b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ endif() find_package(Qt5 COMPONENTS Concurrent Core Network PrintSupport Qml Quick QuickWidgets - Script Sql ${_TEST_QT_COMPONENT} + Sql ${_TEST_QT_COMPONENT} REQUIRED ) @@ -90,7 +90,7 @@ endfunction() qt5_query_qmake() -find_package(Qt5 COMPONENTS Designer Help SerialPort Svg QUIET) +find_package(Qt5 COMPONENTS Designer Help Script SerialPort Svg QUIET) function (set_if_target var target) if (TARGET "${target}") set(_result ON) diff --git a/src/plugins/coreplugin/CMakeLists.txt b/src/plugins/coreplugin/CMakeLists.txt index 5018a9b4c16..77836859692 100644 --- a/src/plugins/coreplugin/CMakeLists.txt +++ b/src/plugins/coreplugin/CMakeLists.txt @@ -1,5 +1,5 @@ add_qtc_plugin(Core - DEPENDS Qt5::PrintSupport Qt5::Qml Qt5::Script Qt5::Sql Qt5::Gui Qt5::GuiPrivate + DEPENDS Qt5::PrintSupport Qt5::Qml Qt5::Sql Qt5::Gui Qt5::GuiPrivate PUBLIC_DEPENDS Aggregation ExtensionSystem Utils app_version SOURCES actionmanager/actioncontainer.cpp actionmanager/actioncontainer.h actionmanager/actioncontainer_p.h @@ -100,7 +100,6 @@ add_qtc_plugin(Core locator/externaltoolsfilter.cpp locator/externaltoolsfilter.h locator/filesystemfilter.cpp locator/filesystemfilter.h locator/filesystemfilter.ui locator/ilocatorfilter.cpp locator/ilocatorfilter.h - locator/javascriptfilter.cpp locator/javascriptfilter.h locator/locator.cpp locator/locator.h locator/locatorconstants.h locator/locatorfiltersfilter.cpp locator/locatorfiltersfilter.h @@ -176,3 +175,11 @@ extend_qtc_plugin(Core CONDITION (NOT WIN32) AND (NOT APPLE) SOURCES progressmanager/progressmanager_x11.cpp ) + +extend_qtc_plugin(Core + CONDITION TARGET Qt5::Script + DEPENDS Qt5::Script + DEFINES WITH_JAVASCRIPTFILTER + SOURCES + locator/javascriptfilter.cpp locator/javascriptfilter.h +)