Tests: Fix pluginspecs test for cmake

Change-Id: I700bd9cbcdabfa08863ffb727a084a9339e660d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Stenger
2021-01-27 11:51:36 +01:00
parent 15b0a902e9
commit ec9a72808f
5 changed files with 9 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ add_qtc_test(tst_pluginspec
DEFINES
PLUGIN_DIR="${CMAKE_CURRENT_BINARY_DIR}"
PLUGINSPEC_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
DLL_INFIX="d${PROJECT_VERSION_MAJOR}"
DEPENDS ExtensionSystem
SOURCES
tst_pluginspec.cpp

View File

@@ -24,3 +24,4 @@ include(../../qttest.pri)
DEFINES += "PLUGINSPEC_DIR=\\\"$$PWD\\\""
DEFINES += "PLUGIN_DIR=\\\"$$OUT_PWD\\\""
DEFINES += "DLL_INFIX=\\\"d$$section(QTCREATOR_VERSION, ., 0, 0)\\\""

View File

@@ -9,7 +9,8 @@ QtcAutotest {
files: "tst_pluginspec.cpp"
cpp.defines: outer.concat([
'PLUGIN_DIR="' + destinationDirectory + '"',
'PLUGINSPEC_DIR="' + sourceDirectory + '"'
'PLUGINSPEC_DIR="' + sourceDirectory + '"',
'DLL_INFIX=""'
])
}

View File

@@ -2,9 +2,9 @@
if(APPLE)
set(plugin_output_name "libtest_debug")
elseif(UNIX)
set(plugin_output_name "liblibtest")
set(plugin_output_name "libtest")
else()
set(plugin_output_name "testd4")
set(plugin_output_name "testd")
endif()
file(RELATIVE_PATH TEST_PLUGIN_PATH ${QtCreator_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
@@ -15,13 +15,12 @@ add_qtc_plugin(testplugin
SOURCES
testplugin.cpp testplugin.h
PLUGIN_PATH "${TEST_PLUGIN_PATH}"
PROPERTIES
OUTPUT_NAME ${plugin_output_name}
SKIP_INSTALL
INTERNAL_ONLY
)
# The empty string gets removed if I put it above
if (TARGET testplugin)
set_target_properties(testplugin PROPERTIES PREFIX "")
set_target_properties(testplugin PROPERTIES PREFIX ""
OUTPUT_NAME "${plugin_output_name}")
endif()

View File

@@ -60,7 +60,7 @@ static QString libraryName(const QString &basename)
#elif defined(Q_OS_UNIX)
return QLatin1String("lib") + basename + QLatin1String(".so");
#else
return basename + QLatin1String("d4.dll");
return basename + QLatin1String(DLL_INFIX ".dll");
#endif
}