forked from qt-creator/qt-creator
Tests: Fix pluginspecs test for cmake
Change-Id: I700bd9cbcdabfa08863ffb727a084a9339e660d5 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -4,6 +4,7 @@ add_qtc_test(tst_pluginspec
|
|||||||
DEFINES
|
DEFINES
|
||||||
PLUGIN_DIR="${CMAKE_CURRENT_BINARY_DIR}"
|
PLUGIN_DIR="${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
PLUGINSPEC_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
|
PLUGINSPEC_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
DLL_INFIX="d${PROJECT_VERSION_MAJOR}"
|
||||||
DEPENDS ExtensionSystem
|
DEPENDS ExtensionSystem
|
||||||
SOURCES
|
SOURCES
|
||||||
tst_pluginspec.cpp
|
tst_pluginspec.cpp
|
||||||
|
@@ -24,3 +24,4 @@ include(../../qttest.pri)
|
|||||||
|
|
||||||
DEFINES += "PLUGINSPEC_DIR=\\\"$$PWD\\\""
|
DEFINES += "PLUGINSPEC_DIR=\\\"$$PWD\\\""
|
||||||
DEFINES += "PLUGIN_DIR=\\\"$$OUT_PWD\\\""
|
DEFINES += "PLUGIN_DIR=\\\"$$OUT_PWD\\\""
|
||||||
|
DEFINES += "DLL_INFIX=\\\"d$$section(QTCREATOR_VERSION, ., 0, 0)\\\""
|
||||||
|
@@ -9,7 +9,8 @@ QtcAutotest {
|
|||||||
files: "tst_pluginspec.cpp"
|
files: "tst_pluginspec.cpp"
|
||||||
cpp.defines: outer.concat([
|
cpp.defines: outer.concat([
|
||||||
'PLUGIN_DIR="' + destinationDirectory + '"',
|
'PLUGIN_DIR="' + destinationDirectory + '"',
|
||||||
'PLUGINSPEC_DIR="' + sourceDirectory + '"'
|
'PLUGINSPEC_DIR="' + sourceDirectory + '"',
|
||||||
|
'DLL_INFIX=""'
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(plugin_output_name "libtest_debug")
|
set(plugin_output_name "libtest_debug")
|
||||||
elseif(UNIX)
|
elseif(UNIX)
|
||||||
set(plugin_output_name "liblibtest")
|
set(plugin_output_name "libtest")
|
||||||
else()
|
else()
|
||||||
set(plugin_output_name "testd4")
|
set(plugin_output_name "testd")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(RELATIVE_PATH TEST_PLUGIN_PATH ${QtCreator_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
file(RELATIVE_PATH TEST_PLUGIN_PATH ${QtCreator_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
@@ -15,13 +15,12 @@ add_qtc_plugin(testplugin
|
|||||||
SOURCES
|
SOURCES
|
||||||
testplugin.cpp testplugin.h
|
testplugin.cpp testplugin.h
|
||||||
PLUGIN_PATH "${TEST_PLUGIN_PATH}"
|
PLUGIN_PATH "${TEST_PLUGIN_PATH}"
|
||||||
PROPERTIES
|
|
||||||
OUTPUT_NAME ${plugin_output_name}
|
|
||||||
SKIP_INSTALL
|
SKIP_INSTALL
|
||||||
INTERNAL_ONLY
|
INTERNAL_ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
# The empty string gets removed if I put it above
|
# The empty string gets removed if I put it above
|
||||||
if (TARGET testplugin)
|
if (TARGET testplugin)
|
||||||
set_target_properties(testplugin PROPERTIES PREFIX "")
|
set_target_properties(testplugin PROPERTIES PREFIX ""
|
||||||
|
OUTPUT_NAME "${plugin_output_name}")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -60,7 +60,7 @@ static QString libraryName(const QString &basename)
|
|||||||
#elif defined(Q_OS_UNIX)
|
#elif defined(Q_OS_UNIX)
|
||||||
return QLatin1String("lib") + basename + QLatin1String(".so");
|
return QLatin1String("lib") + basename + QLatin1String(".so");
|
||||||
#else
|
#else
|
||||||
return basename + QLatin1String("d4.dll");
|
return basename + QLatin1String(DLL_INFIX ".dll");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user