Commit c1dc4394 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

beautify installation of pluginspecs

use the data copying custom compiler approach here, too.
this leaves more work to qmake, which is good.
on the upside, pluginspecs will be installed when they change without
having force a re-link of the plugin itself.
on the downside, installation of a pluginspec will force a re-link of
the plugin. oh, well - you can't have it all (with qmake) ...
parent e4768944
......@@ -16,6 +16,19 @@ defineReplace(targetPath) {
return($$1)
}
# For use in custom compilers which just copy files
win32:i_flag = i
defineReplace(stripSrcDir) {
win32 {
!contains(1, ^.:.*):1 = $$OUT_PWD/$$1
} else {
!contains(1, ^/.*):1 = $$OUT_PWD/$$1
}
out = $$cleanPath($$1)
out ~= s|^$$re_escape($$PWD/)||$$i_flag
return($$out)
}
isEmpty(TEST):CONFIG(debug, debug|release) {
!debug_and_release|build_pass {
TEST = 1
......@@ -49,6 +62,7 @@ macx {
copydata = 1
} else {
win32 {
contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
IDE_APP_TARGET = qtcreator
} else {
IDE_APP_WRAPPER = qtcreator
......
include(../../qtcreator.pri)
win32:i_flag = i
defineReplace(stripSrcDir) {
win32 {
!contains(1, ^.:.*):1 = $$OUT_PWD/$$1
} else {
!contains(1, ^/.*):1 = $$OUT_PWD/$$1
}
out = $$cleanPath($$1)
out ~= s|^$$re_escape($$PWD/)||$$i_flag
return($$out)
}
contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
TEMPLATE = app
TARGET = phony_target
......
......@@ -14,25 +14,17 @@ isEmpty(TARGET) {
error("qworkbenchplugin.pri: You must provide a TARGET")
}
# Copy the pluginspec file to the library directory.
# Note: On Windows/MinGW with some sh.exe in the path,
# QMAKE_COPY is some cp command that does not understand
# "\". Force the standard windows copy.
COPYDEST = $${DESTDIR}
COPYSRC = $${_PRO_FILE_PWD_}/$${TARGET}.pluginspec
PLUGINSPECS = $${_PRO_FILE_PWD_}/$${TARGET}.pluginspec
copy2build.input = PLUGINSPECS
copy2build.output = $$DESTDIR/${QMAKE_FUNC_FILE_IN_stripSrcDir}
isEmpty(vcproj):copy2build.variable_out = PRE_TARGETDEPS
copy2build.commands = $$QMAKE_COPY \"${QMAKE_FILE_IN}\" \"${QMAKE_FILE_OUT}\"
copy2build.name = COPY ${QMAKE_FILE_IN}
copy2build.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += copy2build
TARGET = $$qtLibraryTarget($$TARGET)
win32 {
COPYDEST ~= s|/+|\|
COPYSRC ~= s|/+|\|
COPY_CMD=xcopy /y
} else {
COPY_CMD=$${QMAKE_COPY}
}
QMAKE_POST_LINK += $${COPY_CMD} $${COPYSRC} $${COPYDEST}
macx {
QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../PlugIns/$${PROVIDER}/
} else:linux-* {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment