Skip to content

Commit

Permalink
Changes: add mAddLibrary function, use it in .pro files
Browse files Browse the repository at this point in the history
RevBy: Armin, Mirek
Details: To simplify addition of a link library to a
project for the different platforms, we need this function.

Initial patch by Thierry Bastian.
  • Loading branch information
Holger Schröder committed Oct 27, 2010
1 parent 2250a5c commit cd0fe33
Show file tree
Hide file tree
Showing 38 changed files with 101 additions and 201 deletions.
10 changes: 1 addition & 9 deletions benchmarks/common_top.pri
Expand Up @@ -25,15 +25,7 @@ DEFINES += UNIT_TEST
target.path = $$[QT_INSTALL_LIBS]/libmeegotouch-benchmarks
INSTALLS += target

win32|macx {
macx {
QMAKE_LFLAGS += -F../../lib
LIBS += -framework m
}
win32:LIBS += -lmeegotouchcore0
} else {
LIBS += -lmeegotouchcore
}
LIBS += $$mAddLibrary(meegotouchcore)

support_files.files =
support_files.path = $$[QT_INSTALL_LIBS]/libmeegotouch-benchmarks
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/mt_mlabel/mt_mlabel.pro
Expand Up @@ -7,4 +7,4 @@ SOURCES += mt_mlabel.cpp
HEADERS += mt_mlabel.h
CONFIG += release

LIBS += -lmeegotouchviews
LIBS += $$mAddLibrary(meegotouchviews)
2 changes: 1 addition & 1 deletion benchmarks/pt_mlabel/pt_mlabel.pro
Expand Up @@ -6,4 +6,4 @@ TARGET = pt_mlabel
SOURCES += pt_mlabel.cpp
HEADERS += pt_mlabel.h

LIBS += -lmeegotouchviews
LIBS += $$mAddLibrary(meegotouchviews)
2 changes: 1 addition & 1 deletion benchmarks/pt_mprogressindicator/pt_mprogressindicator.pro
Expand Up @@ -6,4 +6,4 @@ TARGET = pt_mprogressindicator
SOURCES += pt_mprogressindicator.cpp
HEADERS += pt_mprogressindicator.h

LIBS += -lmeegotouchviews
LIBS += $$mAddLibrary(meegotouchviews)
7 changes: 1 addition & 6 deletions demos/animatedlayout/animatedlayout.pro
Expand Up @@ -13,12 +13,7 @@ INCLUDEPATH += \
QMAKE_LIBDIR += \
$$MLIB

macx {
QMAKE_LFLAGS += -F../../lib
LIBS += -framework meegotouchcore
} else {
LIBS += -lmeegotouchcore
}
LIBS += $$mAddLibrary(meegotouchcore)

TEMPLATE = app
TARGET = animatedlayout
Expand Down
10 changes: 1 addition & 9 deletions demos/appletinstallationsource/appletinstallationsource.pro
Expand Up @@ -19,15 +19,7 @@ INCLUDEPATH += $$MSRCINCLUDE
HEADERS = fakeinstallationsource.h
SOURCES = fakeinstallationsource.cpp

win32|macx {
macx {
QMAKE_LFLAGS += -F../../lib
LIBS += -framework \
m
}
win32:LIBS += -lmeegotouchcore0
}
else:LIBS += -lmeegotouchcore
LIBS += $$mAddLibrary(meegotouchcore)

TARGET = $$qtLibraryTarget(appletinventory-fakeinstallationsource)
DESTDIR = ../../lib
Expand Down
18 changes: 5 additions & 13 deletions demos/applicationextension/applicationextension.pro
Expand Up @@ -9,19 +9,11 @@ INCLUDEPATH += . \
$$MSRCINCLUDE \
$$MSRC
QMAKE_LIBDIR += $$MLIB
win32|macx {
macx {
QMAKE_LFLAGS += -F../../lib
LIBS += -framework \
m
}
win32:LIBS += -lmeegotouchcore0
}
else:LIBS += \
-lmeegotouchcore \
-lmeegotouchviews \
-lmeegotouchsettings \
-lmeegotouchextensions \

LIBS += $$mAddLibrary(meegotouchcore) \
$$mAddLibrary(meegotouchviews) \
$$mAddLibrary(meegotouchsettings) \
$$mAddLibrary(meegotouchextensions)

TEMPLATE = app
TARGET = applicationextensiondemo
Expand Down
10 changes: 1 addition & 9 deletions demos/applicationextension/demoextension/demoextension.pro
Expand Up @@ -18,15 +18,7 @@ INCLUDEPATH += $$MSRCINCLUDE ../
HEADERS = demoextension.h
SOURCES = demoextension.cpp

win32|macx {
macx {
QMAKE_LFLAGS += -F../../../lib
LIBS += -framework \
m
}
win32:LIBS += -lmeegotouchcore0
}
else:LIBS += -lmeegotouchcore
LIBS += $$mAddLibrary(meegotouchcore)

TARGET = $$qtLibraryTarget(applicationextensiondemo-demoextension)
DESTDIR = ../../../lib
Expand Down
10 changes: 1 addition & 9 deletions demos/applicationextension/demoextension2/demoextension2.pro
Expand Up @@ -18,15 +18,7 @@ INCLUDEPATH += $$MSRCINCLUDE ../
HEADERS = demoextension.h
SOURCES = demoextension.cpp

win32|macx {
macx {
QMAKE_LFLAGS += -F../../../lib
LIBS += -framework \
m
}
win32:LIBS += -lmeegotouchcore0
}
else:LIBS += -lmeegotouchcore
LIBS += $$mAddLibrary(meegotouchcore)

TARGET = $$qtLibraryTarget(applicationextensiondemo-demoextension2)
DESTDIR = ../../../lib
Expand Down
15 changes: 3 additions & 12 deletions demos/widgetsgallery/applets/galleryapplet/galleryapplet.pro
Expand Up @@ -13,18 +13,9 @@ INCLUDEPATH += . \
$$MSRC/mashup/appletinterface

QMAKE_LIBDIR += \
$$MLIB \

win32|macx {
macx {
QMAKE_LFLAGS += -F$$MLIB
LIBS += -framework m
}
win32:LIBS += -lmeegotouchcore0
} else {
LIBS += -lmeegotouchcore
}

$$MLIB

LIBS += $$mAddLibrary(meegotouchcore)

HEADERS = galleryapplet.h \
gallery.h \
Expand Down
19 changes: 5 additions & 14 deletions demos/widgetsgallery/widgetsgallery.pro
Expand Up @@ -9,20 +9,11 @@ INCLUDEPATH += . \
$$MSRC/corelib

QMAKE_LIBDIR += $$MLIB
win32|macx {
macx {
QMAKE_LFLAGS += -F../../lib
LIBS += -framework meegotouchcore \
-framework meegotouchviews
}
win32:LIBS += -lmeegotouchcore0 \
-lmeegotouchviews0
}
else:LIBS += \
-lmeegotouchcore \
-lmeegotouchviews \
-lmeegotouchsettings \
-lmeegotouchextensions \

LIBS += $$mAddLibrary(meegotouchcore) \
$$mAddLibrary(meegotouchviews) \
$$mAddLibrary(meegotouchsettings) \
$$mAddLibrary(meegotouchextensions)

TEMPLATE = app
TARGET = widgetsgallery
Expand Down
4 changes: 3 additions & 1 deletion examples/chaining/common.pri
@@ -1,6 +1,8 @@
include( ../common.pri )

INCLUDEPATH += ../../../src/include
QMAKE_LIBDIR += ../../../lib/
LIBS += -lmeegotouchcore
LIBS += $$mAddLibrary(meegotouchcore)

DEPENDPATH += .
INCLUDEPATH += .
8 changes: 5 additions & 3 deletions examples/common.pri
@@ -1,6 +1,8 @@
INCLUDEPATH += ../../src/include
QMAKE_LIBDIR += ../../lib/
LIBS += -lmeegotouchcore
include( ../mkspecs/common.pri )

INCLUDEPATH += $$M_SOURCE_TREE/src/include

LIBS += $$mAddLibrary(meegotouchcore)

DEPENDPATH += .
INCLUDEPATH += .
6 changes: 5 additions & 1 deletion examples/helloworld/helloworld.pro
@@ -1,4 +1,8 @@
include( ../common.pri )
include(../common.pri)


LIBS += $$mAddLibrary(meegotouchcore)


TEMPLATE = app
TARGET = helloworld
Expand Down
7 changes: 1 addition & 6 deletions examples/layout/common.pri
@@ -1,6 +1 @@
INCLUDEPATH += ../../../src/include
QMAKE_LIBDIR += ../../../lib/
LIBS += -lmeegotouchcore

DEPENDPATH += .
INCLUDEPATH += .
include (../common.pri)
6 changes: 3 additions & 3 deletions examples/lifecycle/lifecycle.pro
@@ -1,8 +1,8 @@
include( ../common.pri )

LIBS += -lmeegotouchsettings
LIBS += -lmeegotouchviews
LIBS += -lmeegotouchextensions
LIBS += $$mAddLibrary(meegotouchsettings) \
$$mAddLibrary(meegotouchviews) \
$$mAddLibrary(meegotouchextensions)

TEMPLATE = app
TARGET = lifecycle
Expand Down
4 changes: 2 additions & 2 deletions examples/servicefw/user/user.pro
Expand Up @@ -30,9 +30,9 @@ SOURCES = \
echowindow.cpp \
main.cpp \

LIBS += $$mAddLibrary(meegotouchcore)
LIBS += \
-lmeegotouchcore \
-ltextprocessor \
-ltextprocessor

target.path = $$M_INSTALL_BIN

Expand Down
6 changes: 3 additions & 3 deletions examples/testwidget/testwidget.pro
Expand Up @@ -14,9 +14,9 @@ win32 {

include( ../../mkspecs/features/meegotouch_mgen.prf )

LIBS += -lmeegotouchsettings
LIBS += -lmeegotouchviews
LIBS += -lmeegotouchextensions
LIBS += $$mAddLibrary(meegotouchsettings) \
$$mAddLibrary(meegotouchviews) \
$$mAddLibrary(meegotouchextensions)

TEMPLATE = app
TARGET = testwidget
Expand Down
9 changes: 4 additions & 5 deletions mappletrunner/mappletrunner.pro
Expand Up @@ -12,11 +12,10 @@ TEMPLATE = app
TARGET =
DEPENDPATH += .

LIBS += \
-lmeegotouchcore \
-lmeegotouchviews \
-lmeegotouchsettings \
-lmeegotouchextensions \
LIBS += $$mAddLibrary(meegotouchcore) \
$$mAddLibrary(meegotouchviews) \
$$mAddLibrary(meegotouchsettings) \
$$mAddLibrary(meegotouchextensions)

QT += core \
network \
Expand Down
9 changes: 4 additions & 5 deletions mapplicationextensionrunner/mapplicationextensionrunner.pro
Expand Up @@ -13,11 +13,10 @@ TEMPLATE = app
TARGET =
DEPENDPATH += .

LIBS += \
-lmeegotouchcore \
-lmeegotouchviews \
-lmeegotouchsettings \
-lmeegotouchextensions \
LIBS += $$mAddLibrary(meegotouchcore) \
$$mAddLibrary(meegotouchviews) \
$$mAddLibrary(meegotouchsettings) \
$$mAddLibrary(meegotouchextensions)

QT += core \
network \
Expand Down
11 changes: 4 additions & 7 deletions mkspecs/features/meegotouch.prf
@@ -1,13 +1,10 @@
include(meegotouch_common.prf)

macx {
LIBS += \
-framework meegotouchcore
} else {
LIBS += $$mAddLibrary(meegotouchcore)
!macx {
!contains(DEFINES, BUILD_M) {
LIBS += \
-lmeegotouchcore \
-lmeegotouchsettings \
-lmeegotouchextensions
$$mAddLibrary(meegotouchsettings) \
$$mAddLibrary(meegotouchextensions)
}
}
17 changes: 17 additions & 0 deletions mkspecs/features/meegotouch_defines.prf.in
Expand Up @@ -108,3 +108,20 @@ win32 {
M_DBUS_INTERFACES_DIR = /usr/share/dbus-1/interfaces
M_DBUS_SERVICES_DIR = $$M_INSTALL_DATA/dbus-1/services
}

defineReplace(mAddLibrary) {
LIBRARY_NAME = $$1
macx {
QMAKE_LFLAGS *= -F $$M_BUILD_TREE/lib
return (-framework $$LIBRARY_NAME)
} else {
win32 {
CONFIG(debug, debug|release) {
return ("-l"$${LIBRARY_NAME}d$${M_MAJOR_VERSION})
} else {
return ("-l"$${LIBRARY_NAME}$${M_MAJOR_VERSION})
}
}
return (-l$$LIBRARY_NAME)
}
}
8 changes: 1 addition & 7 deletions mkspecs/features/meegotouchcore.prf
@@ -1,9 +1,3 @@
include(meegotouch_common.prf)

macx {
LIBS += -framework meegotouchcore
} else {
!contains(DEFINES, BUILD_M) {
LIBS += -lmeegotouchcore
}
}
LIBS += $$mAddLibrary(meegotouchcore)
13 changes: 2 additions & 11 deletions mkspecs/features/meegotouchsettings.prf
@@ -1,13 +1,4 @@
include(meegotouch_common.prf)

macx {
LIBS += \
-framework meegotouchcore \
-framework meegotouchsettings \
} else {
!contains(DEFINES, BUILD_M) {
LIBS += \
-lmeegotouchcore \
-lmeegotouchsettings \
}
}
LIBS += $$mAddLibrary(meegotouchcore) \
$$mAddLibrary(meegotouchsettings)
3 changes: 2 additions & 1 deletion src/extensions/extensions.pro
Expand Up @@ -21,7 +21,8 @@ contains(DEFINES, HAVE_DBUS) {
include(style/style.pri)
}

LIBS += -lmeegotouchviews -lmeegotouchsettings -lmeegotouchcore

LIBS += $$mAddLibrary(meegotouchcore) $$mAddLibrary(meegotouchsettings) $$mAddLibrary(meegotouchviews)

SOURCES += mextensionwatcher.cpp \
mextensionslibrary.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/settings/settings.pro
Expand Up @@ -13,6 +13,6 @@ include(settingslanguage/settingslanguage.pri)

SOURCES += msettingslibrary.cpp

LIBS += -lmeegotouchcore
LIBS += $$mAddLibrary(meegotouchcore)

include(../common_bot.pri)
9 changes: 1 addition & 8 deletions src/views/views.pro
Expand Up @@ -21,14 +21,7 @@ include(animations/animations.pri)
include(style/style.pri)
include(video/video.pri)

win32|macx {
macx {
QMAKE_LFLAGS += -F../../lib
LIBS += -framework meegotouchcore
}
win32:LIBS += -lmeegotouchcore0
}
else:LIBS += -lmeegotouchcore
LIBS += $$mAddLibrary(meegotouchcore)

SOURCES += mviewslibrary.cpp

Expand Down
2 changes: 1 addition & 1 deletion tests/common_mextensions.pri
Expand Up @@ -8,4 +8,4 @@ INCLUDEPATH += \
$$MSRCDIR/extensions/mashup/mashup \
$$MSRCDIR/extensions/style \

LIBS += -lmeegotouchextensions
LIBS += $$mAddLibrary(meegotouchextensions)
2 changes: 1 addition & 1 deletion tests/common_msettings.pri
@@ -1,5 +1,5 @@
INCLUDEPATH += \
$$MSRCDIR/settings/settingslanguage \

LIBS += -lmeegotouchsettings
LIBS += $$mAddLibrary(meegotouchsettings)

0 comments on commit cd0fe33

Please sign in to comment.