aboutsummaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2021-01-26 11:50:22 +0100
committerEike Ziller <eike.ziller@qt.io>2021-01-26 13:20:33 +0000
commitacfb2e4f2f19af3f58ab082a08ee76a0106dc990 (patch)
tree3d5d1a06bd218107289027552a12b2e8cfcaf317 /src/CMakeLists.txt
parentd6e50e77ccf9c3c7e2e7a65fe0b082f95b60a728 (diff)
CMake build/Linux: Fix location of separate plugins
We use GNUInstallDirs to define the location of plugins, libraries and so on. If Qt Creator was configured with a specific set of locations, we need to pass that on to separately built plugins even if GNUInstallDirs would use different locations for them. Otherwise Qt Creator cannot find these plugins. Amends c81baf1a9cc938a283f6c52c8fd10bab84183391 Fixes: QTCREATORBUG-25266 Change-Id: Ib0da1428ec676fd54cb264b1aba4791b18b2c3bd Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 483231f905..f822331965 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -39,6 +39,16 @@ file(WRITE ${CMAKE_BINARY_DIR}/cmake/QtCreatorConfig.cmake "
\# add module path for special FindQt5.cmake that considers Qt6 too
list(APPEND CMAKE_MODULE_PATH \${CMAKE_CURRENT_LIST_DIR})
+\# force plugins to same path naming conventions as Qt Creator
+\# otherwise plugins will not be found
+if(UNIX AND NOT APPLE)
+ include(GNUInstallDirs)
+ set(CMAKE_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR})
+ set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
+ set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBEXECDIR})
+ set(CMAKE_INSTALL_DATAROOTDIR ${CMAKE_INSTALL_DATAROOTDIR})
+endif()
+
include(CMakeFindDependencyMacro)
find_dependency(Qt5 ${IDE_QT_VERSION_MIN}
COMPONENTS Concurrent Core Gui Widgets Core5Compat Network PrintSupport Qml Quick QuickWidgets Sql REQUIRED