summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/plugin/qfactoryloader
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-10-23 14:45:20 +0200
committerLeander Beernaert <leander.beernaert@qt.io>2019-10-28 09:20:37 +0000
commit69fb4ae343777af9078e5128ec41cfb3cea2cd76 (patch)
tree7d15b4dde18289f583dc195f121556b04dd85e55 /tests/auto/corelib/plugin/qfactoryloader
parent080f9ad160ef7422b2bab884c7ccc950d35b3a0a (diff)
Distinguish between qt_plugin and regular plugins
If we do not encounter the load(qt_plugin) statement in the .pro file but we do see the entry CONFIG+=plugin, treat the target as a regular CMake library instead of treating it as a qt_plugin by default. Change-Id: I67ad5c865a1a5ab691a6b0d86c2db4b686aa04dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tests/auto/corelib/plugin/qfactoryloader')
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/plugin1/CMakeLists.txt7
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/plugin2/CMakeLists.txt7
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/test/.prev_CMakeLists.txt41
-rw-r--r--tests/auto/corelib/plugin/qfactoryloader/test/CMakeLists.txt22
4 files changed, 63 insertions, 14 deletions
diff --git a/tests/auto/corelib/plugin/qfactoryloader/plugin1/CMakeLists.txt b/tests/auto/corelib/plugin/qfactoryloader/plugin1/CMakeLists.txt
index 56a126c78b..940dcc2b09 100644
--- a/tests/auto/corelib/plugin/qfactoryloader/plugin1/CMakeLists.txt
+++ b/tests/auto/corelib/plugin/qfactoryloader/plugin1/CMakeLists.txt
@@ -1,10 +1,11 @@
# Generated from plugin1.pro.
#####################################################################
-## plugin1 Plugin:
+## plugin1 Generic Library:
#####################################################################
-add_qt_plugin(plugin1
+add_cmake_library(plugin1
+ MODULE
INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qfactoryloader/bin"
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../bin"
SOURCES
@@ -31,3 +32,5 @@ extend_target(plugin1 CONDITION NOT QT_FEATURE_library
DEFINES
QT_STATICPLUGIN
)
+
+qt_autogen_tools_initial_setup(plugin1)
diff --git a/tests/auto/corelib/plugin/qfactoryloader/plugin2/CMakeLists.txt b/tests/auto/corelib/plugin/qfactoryloader/plugin2/CMakeLists.txt
index 5b6e9062cc..2df999c292 100644
--- a/tests/auto/corelib/plugin/qfactoryloader/plugin2/CMakeLists.txt
+++ b/tests/auto/corelib/plugin/qfactoryloader/plugin2/CMakeLists.txt
@@ -1,10 +1,11 @@
# Generated from plugin2.pro.
#####################################################################
-## plugin2 Plugin:
+## plugin2 Generic Library:
#####################################################################
-add_qt_plugin(plugin2
+add_cmake_library(plugin2
+ MODULE
INSTALL_DIRECTORY "${INSTALL_TESTSDIR}/tst_qfactoryloader/bin"
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../bin"
SOURCES
@@ -31,3 +32,5 @@ extend_target(plugin2 CONDITION NOT QT_FEATURE_library
DEFINES
QT_STATICPLUGIN
)
+
+qt_autogen_tools_initial_setup(plugin2)
diff --git a/tests/auto/corelib/plugin/qfactoryloader/test/.prev_CMakeLists.txt b/tests/auto/corelib/plugin/qfactoryloader/test/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..554d51292f
--- /dev/null
+++ b/tests/auto/corelib/plugin/qfactoryloader/test/.prev_CMakeLists.txt
@@ -0,0 +1,41 @@
+# Generated from test.pro.
+
+#####################################################################
+## tst_qfactoryloader Test:
+#####################################################################
+
+add_qt_test(tst_qfactoryloader
+ SOURCES
+ ../plugin1/plugininterface1.h
+ ../plugin2/plugininterface2.h
+ ../tst_qfactoryloader.cpp
+ LIBRARIES
+ Qt::CorePrivate
+)
+
+## Scopes:
+#####################################################################
+
+extend_target(tst_qfactoryloader CONDITION NOT QT_FEATURE_library
+ PUBLIC_LIBRARIES
+ # Remove: L
+ ../bin/
+ plugin1
+ plugin2
+)
+
+if(ANDROID)
+ # Resources:
+ set(qmake_libs_resource_files
+ ${CMAKE_CURRENT_BINARY_DIR}/../bin
+ )
+
+ add_qt_resource(tst_qfactoryloader "qmake_libs"
+ PREFIX
+ "android_test_data"
+ BASE
+ "${CMAKE_CURRENT_BINARY_DIR}/.."
+ FILES
+ ${qmake_libs_resource_files}
+ )
+endif()
diff --git a/tests/auto/corelib/plugin/qfactoryloader/test/CMakeLists.txt b/tests/auto/corelib/plugin/qfactoryloader/test/CMakeLists.txt
index 7d81342b4a..c721aa3a5a 100644
--- a/tests/auto/corelib/plugin/qfactoryloader/test/CMakeLists.txt
+++ b/tests/auto/corelib/plugin/qfactoryloader/test/CMakeLists.txt
@@ -30,8 +30,6 @@ extend_target(tst_qfactoryloader CONDITION NOT QT_FEATURE_library
# this part is handled as a special case above
# ../bin/
# special case end
- plugin1
- plugin2
)
if(ANDROID)
@@ -45,15 +43,19 @@ if(ANDROID)
${CMAKE_CURRENT_BINARY_DIR}/../bin/libplugin2.so
PROPERTIES QT_RESOURCE_TARGET_DEPENDENCY plugin2
)
- # special case end
# Resources:
- set(qmake_libs_resource_files
- # special case begin
- bin/libplugin1.so
- bin/libplugin2.so
- #${CMAKE_CURRENT_BINARY_DIR}/../bin
- # special case end
- )
+ if (ANDROID)
+ set(qmake_libs_resource_files
+ bin/libplugin1_${CMAKE_ANDROID_ARCH_ABI}.so
+ bin/libplugin2_${CMAKE_ANDROID_ARCH_ABI}.so
+ )
+ else()
+ set(qmake_libs_resource_files
+ bin/libplugin1.so
+ bin/libplugin2.so
+ )
+ endif()
+ # special case end
add_qt_resource(tst_qfactoryloader "qmake_libs"
PREFIX