Skip to content

Commit

Permalink
restore qt4's qtLibraryTarget() behavior
Browse files Browse the repository at this point in the history
the function is used in our examples and code generated by qt-creator,
so the qt5-specific magic behavior is inappropriate. create a separate
function instead.

Task-number: QTBUG-44595
Change-Id: I4d72cc1e5cbfc274b3210520baa213f4c5479ca9
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
ossilator committed Mar 5, 2015
1 parent 8c0ef14 commit 67289d0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion mkspecs/features/qml_plugin.prf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ INSTALLS += target

# Some final setup

TARGET = $$qtLibraryTarget($$TARGET)
TARGET = $$qt5LibraryTarget($$TARGET)

load(qt_targets)
load(qt_common)
Expand Down
16 changes: 11 additions & 5 deletions mkspecs/features/qt_functions.prf
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ defineReplace(qtLibraryTarget) {
mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME
export(QMAKE_FRAMEWORK_BUNDLE_NAME)
} else {
# insert the major version of Qt in the library name
# unless it's a framework build
LIBRARY_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
}
return($$LIBRARY_NAME$$qtPlatformTargetSuffix())
}

defineReplace(qt5LibraryTarget) {
LIBRARY_NAME = $$qtLibraryTarget($$1)
isEmpty(QMAKE_FRAMEWORK_BUNDLE_NAME) {
# Insert the major version of Qt in the library name
# unless it's a framework build.
LIBRARY_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
}
return($$LIBRARY_NAME)
}

defineTest(qtAddLibrary) {
warning("qtAddLibrary() is deprecated. Use QT+= instead.")

Expand Down Expand Up @@ -100,7 +106,7 @@ defineTest(qtAddModule) {
# to give access to sources or include files, and not for linking.
!isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link) {

# Re-insert the major version in the library name (cf qtLibraryTarget above)
# Re-insert the major version in the library name (cf qt5LibraryTarget above)
# unless it's a framework build
!mac|!contains(MODULE_CONFIG, lib_bundle): \
MODULE_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/features/qt_helper_lib.prf
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin
# as in this case they are not linked to the final library/plugin.
installed|contains(QT_CONFIG, static): load(qt_installs)

TARGET = $$qtLibraryTarget($$TARGET)
TARGET = $$qt5LibraryTarget($$TARGET)
2 changes: 1 addition & 1 deletion mkspecs/features/qt_module.prf
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,4 @@ win32 {
DEFINES *= QT_DISABLE_DEPRECATED_BEFORE=0x050000
}

TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end
TARGET = $$qt5LibraryTarget($$TARGET$$QT_LIBINFIX) # Do this towards the end
2 changes: 1 addition & 1 deletion mkspecs/features/qt_plugin.prf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ CONFIG(static, static|shared)|prefix_build {
target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE
INSTALLS += target

TARGET = $$qtLibraryTarget($$TARGET)
TARGET = $$qt5LibraryTarget($$TARGET)

CONFIG += create_cmake

Expand Down

0 comments on commit 67289d0

Please sign in to comment.