Skip to content

Commit

Permalink
qmake|Windows: Write built binaries directly to "distrib/products"
Browse files Browse the repository at this point in the history
Now DESTDIR and DLLDESTDIR are used to write all built binaries directly
to the distrib folder. This cuts down on the time needed for running
the install target. Installing remains necessary, though, as it copies
all the supporting files.

windeployqt is now run by postbuild, making it unnecessary to manually copy
any Qt libraries to the distrib folder.
  • Loading branch information
skyjake committed Aug 1, 2014
1 parent 2bf3dea commit 6394864
Show file tree
Hide file tree
Showing 33 changed files with 88 additions and 129 deletions.
8 changes: 8 additions & 0 deletions doomsday/build/build.pro
Expand Up @@ -24,6 +24,14 @@ QMAKE_STRIP = true
runPython2InDir($$PWD/scripts/, packres.py --quiet \"$$OUT_PWD/..\")
}

# Create the output directories on Windows.
win32 {
mkpath($$DENG_WIN_PRODUCTS_DIR)
mkpath($$DENG_BIN_DIR)
mkpath($$DENG_LIB_DIR)
mkpath($$DENG_PLUGIN_LIB_DIR)
}

# Install the launcher.
!deng_sdk:deng_snowberry {
SB_ROOT = ../../snowberry
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/client.pro
Expand Up @@ -850,12 +850,12 @@ macx {
DENG_PACKAGES += net.dengine.client.pack

deployPackages($$DENG_PACKAGES, $$OUT_PWD/..)
deployTarget()

!macx {
# Common (non-Mac) parts of the installation.
INSTALLS += target data startupfonts
INSTALLS += data startupfonts

target.path = $$DENG_BIN_DIR
data.path = $$DENG_DATA_DIR
startupfonts.path = $$DENG_DATA_DIR/fonts

Expand Down
2 changes: 1 addition & 1 deletion doomsday/dep_core.pri
Expand Up @@ -27,7 +27,7 @@ win32: defineReplace(qtLibraryFile) {
deng_debug: qtver = d$$QT_MAJOR_VERSION
else: qtver = $$QT_MAJOR_VERSION

win32 {
win32:!greaterThan(QT_MAJOR_VERSION, 4) {
# Install the required Qt DLLs into the products dir.
INSTALLS *= qtlibs qtplugins
qtlibs.files += \
Expand Down
9 changes: 1 addition & 8 deletions doomsday/libappfw/libappfw.pro
Expand Up @@ -256,12 +256,5 @@ macx {
doPostLink("mkdir -p ../client/Doomsday.app/Contents/Frameworks")
doPostLink("cp -fRp libdeng_appfw*dylib ../client/Doomsday.app/Contents/Frameworks")
}
else {
INSTALLS += target
target.path = $$DENG_LIB_DIR
}

deng_sdk {
INSTALLS *= target
target.path = $$DENG_SDK_LIB_DIR
}
deployLibrary()
8 changes: 2 additions & 6 deletions doomsday/libcore/libcore.pro
Expand Up @@ -197,13 +197,9 @@ macx {
doPostLink("cp -fRp libdeng_core*dylib ../client/Doomsday.app/Contents/Frameworks")
}

!macx {
INSTALLS += target
target.path = $$DENG_LIB_DIR
}
deployLibrary()

deng_sdk {
INSTALLS *= target scripts
target.path = $$DENG_SDK_LIB_DIR
INSTALLS *= scripts
scripts.path = $$DENG_SDK_DIR/modules
}
6 changes: 2 additions & 4 deletions doomsday/libdoomsday/libdoomsday.pro
Expand Up @@ -150,7 +150,5 @@ macx {
doPostLink("mkdir -p ../client/Doomsday.app/Contents/Frameworks")
doPostLink("cp -fRp libdeng_doomsday*dylib ../client/Doomsday.app/Contents/Frameworks")
}
else {
INSTALLS += target
target.path = $$DENG_LIB_DIR
}

deployLibrary()
9 changes: 3 additions & 6 deletions doomsday/libgui/libgui.pro
Expand Up @@ -228,13 +228,10 @@ macx {
doPostLink("install_name_tool -id @rpath/libassimp.3.dylib libassimp.3.dylib")
linkBinaryToBundledAssimp(libdeng_gui.1.dylib, ..)
}
else {
INSTALLS += target
target.path = $$DENG_LIB_DIR
}

deployLibrary()

deng_sdk {
INSTALLS *= target scripts
target.path = $$DENG_SDK_LIB_DIR
INSTALLS *= scripts
scripts.path = $$DENG_SDK_DIR/modules
}
6 changes: 2 additions & 4 deletions doomsday/liblegacy/liblegacy.pro
Expand Up @@ -134,7 +134,5 @@ macx {
doPostLink("mkdir -p ../client/Doomsday.app/Contents/Frameworks")
doPostLink("cp -fRp libdeng_legacy*dylib ../client/Doomsday.app/Contents/Frameworks")
}
else {
INSTALLS += target
target.path = $$DENG_LIB_DIR
}

deployLibrary()
9 changes: 1 addition & 8 deletions doomsday/libshell/libshell.pro
Expand Up @@ -115,12 +115,5 @@ macx {
doPostLink("mkdir -p ../client/Doomsday.app/Contents/Frameworks")
doPostLink("cp -fRp libdeng_shell*dylib ../client/Doomsday.app/Contents/Frameworks")
}
else {
INSTALLS += target
target.path = $$DENG_LIB_DIR
}

deng_sdk {
INSTALLS *= target
target.path = $$DENG_SDK_LIB_DIR
}
deployLibrary()
31 changes: 31 additions & 0 deletions doomsday/macros.pri
Expand Up @@ -70,6 +70,37 @@ defineTest(doPostLink) {
export(QMAKE_POST_LINK)
}

defineTest(deployTarget) {
unix:!macx {
INSTALLS += target
target.path = $$DENG_BIN_DIR
export(INSTALLS)
export(target.path)
}
else:win32 {
DESTDIR = $$DENG_BIN_DIR
export(DESTDIR)
}
}

defineTest(deployLibrary) {
win32 {
DLLDESTDIR = $$DENG_LIB_DIR
export(DLLDESTDIR)
}
unix:!macx {
INSTALLS += target
target.path = $$DENG_LIB_DIR
export(target.path)
}
deng_sdk {
INSTALLS *= target
target.path = $$DENG_SDK_LIB_DIR
export(target.path)
}
export(INSTALLS)
}

macx {
defineTest(removeQtLibPrefix) {
doPostLink("install_name_tool -change $$[QT_INSTALL_LIBS]/$$2 $$2 $$1")
Expand Down
7 changes: 7 additions & 0 deletions doomsday/plugins/config_plugin.pri
Expand Up @@ -11,9 +11,16 @@ macx {
CONFIG += lib_bundle
QMAKE_BUNDLE_EXTENSION = .bundle
}
unix:!macx {
INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
}
win32 {
# Keep the version number out of the file name.
TARGET_EXT = .dll

# Deploy plugin DLLs to the plugins folder.
DLLDESTDIR = $$DENG_PLUGIN_LIB_DIR
}

INCLUDEPATH += $$DENG_API_DIR
Expand Down
5 changes: 0 additions & 5 deletions doomsday/plugins/dehread/dehread.pro
Expand Up @@ -38,11 +38,6 @@ win32 {
RC_FILE = res/dehread.rc
}

!macx {
INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
}

macx {
fixPluginInstallId($$TARGET, 2)
linkToBundledLibcore ($$TARGET)
Expand Down
3 changes: 0 additions & 3 deletions doomsday/plugins/directsound/directsound.pro
Expand Up @@ -21,6 +21,3 @@ SOURCES += src/driver_directsound.cpp
RC_FILE = res/directsound.rc
QMAKE_LFLAGS += /DEF:\"$$PWD/api/dsdirectsound.def\"
OTHER_FILES += api/dsdirectsound.def

INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
5 changes: 1 addition & 4 deletions doomsday/plugins/doom/doom.pro
Expand Up @@ -17,13 +17,10 @@ gamedata.files = $$OUT_PWD/../../libdoom.pk3

macx {
gamedata.path = Contents/Resources

QMAKE_BUNDLE_DATA += gamedata
}
else {
INSTALLS += target gamedata

target.path = $$DENG_PLUGIN_LIB_DIR
INSTALLS += gamedata
gamedata.path = $$DENG_DATA_DIR/jdoom
}

Expand Down
5 changes: 1 addition & 4 deletions doomsday/plugins/doom64/doom64.pro
Expand Up @@ -17,13 +17,10 @@ gamedata.files = $$OUT_PWD/../../libdoom64.pk3

macx {
gamedata.path = Contents/Resources

QMAKE_BUNDLE_DATA += gamedata
}
else {
INSTALLS += target gamedata

target.path = $$DENG_PLUGIN_LIB_DIR
INSTALLS += gamedata
gamedata.path = $$DENG_DATA_DIR/jdoom64
}

Expand Down
5 changes: 0 additions & 5 deletions doomsday/plugins/example/example.pro
Expand Up @@ -28,11 +28,6 @@ win32 {
$$RC_FILE
}

!macx {
INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
}

macx {
fixPluginInstallId($$TARGET, 1)
linkToBundledLiblegacy($$TARGET)
Expand Down
7 changes: 0 additions & 7 deletions doomsday/plugins/fluidsynth/fluidsynth.pro
Expand Up @@ -22,19 +22,12 @@ win32 {

QMAKE_LFLAGS += /DEF:\"$$PWD/api/dsfluidsynth.def\"
OTHER_FILES += api/dsfluidsynth.def

INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
}
macx {
fixPluginInstallId($$TARGET, 1)
linkToBundledLibcore($$TARGET)
linkToBundledLiblegacy($$TARGET)
}
unix:!macx {
INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
}

INCLUDEPATH += include

Expand Down
7 changes: 0 additions & 7 deletions doomsday/plugins/fmod/fmod.pro
Expand Up @@ -38,18 +38,11 @@ win32 {

QMAKE_LFLAGS += /DEF:\"$$PWD/api/dsfmod.def\"
OTHER_FILES += api/dsfmod.def

INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
}
else:macx {
fixPluginInstallId($$TARGET, 1)
doPostLink("install_name_tool -change ./libfmodex.dylib @rpath/libfmodex.dylib audio_fmod.bundle/audio_fmod")
}
else {
INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
}

macx {
linkToBundledLibcore(audio_fmod)
Expand Down
5 changes: 1 addition & 4 deletions doomsday/plugins/heretic/heretic.pro
Expand Up @@ -17,13 +17,10 @@ gamedata.files = $$OUT_PWD/../../libheretic.pk3

macx {
gamedata.path = Contents/Resources

QMAKE_BUNDLE_DATA += gamedata
}
else {
INSTALLS += target gamedata

target.path = $$DENG_PLUGIN_LIB_DIR
INSTALLS += gamedata
gamedata.path = $$DENG_DATA_DIR/jheretic
}

Expand Down
5 changes: 1 addition & 4 deletions doomsday/plugins/hexen/hexen.pro
Expand Up @@ -17,13 +17,10 @@ gamedata.files = $$OUT_PWD/../../libhexen.pk3

macx {
gamedata.path = Contents/Resources

QMAKE_BUNDLE_DATA += gamedata
}
else {
INSTALLS += target gamedata

target.path = $$DENG_PLUGIN_LIB_DIR
INSTALLS += gamedata
gamedata.path = $$DENG_DATA_DIR/jhexen
}

Expand Down
5 changes: 0 additions & 5 deletions doomsday/plugins/idtech1converter/idtech1converter.pro
Expand Up @@ -34,11 +34,6 @@ win32 {
OTHER_FILES += api/dpidtech1converter.def
}

!macx {
INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
}

macx {
fixPluginInstallId($$TARGET, 1)
linkToBundledLibcore($$TARGET)
Expand Down
5 changes: 0 additions & 5 deletions doomsday/plugins/openal/openal.pro
Expand Up @@ -24,11 +24,6 @@ win32 {
OTHER_FILES += api/dsopenal.def
}

!macx {
INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
}

macx {
linkToBundledLibcore(audio_openal)
linkToBundledLiblegacy(audio_openal)
Expand Down
5 changes: 0 additions & 5 deletions doomsday/plugins/savegameconverter/savegameconverter.pro
Expand Up @@ -29,11 +29,6 @@ win32 {
RC_FILE = res/savegameconverter.rc
}

!macx {
INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
}

macx {
fixPluginInstallId($$TARGET, 1)
linkToBundledLibcore($$TARGET)
Expand Down
3 changes: 0 additions & 3 deletions doomsday/plugins/winmm/winmm.pro
Expand Up @@ -32,6 +32,3 @@ LIBS += -lwinmm
deng_msvc: QMAKE_LFLAGS += /DEF:\"$$PWD/api/dswinmm.def\"
deng_mingw: QMAKE_LFLAGS += --def \"$$PWD/api/dswinmm.def\"
OTHER_FILES += api/dswinmm.def

INSTALLS += target
target.path = $$DENG_PLUGIN_LIB_DIR
7 changes: 7 additions & 0 deletions doomsday/postbuild/postbuild.pro
Expand Up @@ -19,4 +19,11 @@ macx {
"cd \"$$OUT_PWD/..\" && sh \"$$PWD/bundleapp.sh\" \"$$PWD/..\""
}

win32 {
QMAKE_EXTRA_TARGETS += qtdeploy

qtdeploy.target = FORCE
qtdeploy.commands = "windeployqt \"$$DENG_BIN_DIR\Doomsday.exe\""
}

OTHER_FILES = bundleapp.sh
8 changes: 4 additions & 4 deletions doomsday/server/server.pro
Expand Up @@ -415,12 +415,12 @@ macx {

# Installation ---------------------------------------------------------------

deployTarget()

!macx {
# Common (non-Mac) parts of the installation.
INSTALLS += target data

target.path = $$DENG_BIN_DIR
data.path = $$DENG_DATA_DIR
INSTALLS += data
data.path = $$DENG_DATA_DIR

win32 {
# Windows-specific installation.
Expand Down
6 changes: 3 additions & 3 deletions doomsday/tests/config_test.pri
Expand Up @@ -28,8 +28,7 @@ else:win32 {

target.path = $$DENG_BIN_DIR

defineTest(deployTest) {
INSTALLS += target
defineTest(deployTest) {
deployPackages($$DENG_PACKAGES, $$OUT_PWD/../..)
export(INSTALLS)
export(dengPacks.files)
Expand All @@ -40,10 +39,11 @@ else {
target.path = $$DENG_BIN_DIR

defineTest(deployTest) {
INSTALLS += target
deployPackages(DENG_PACKAGES, $$OUT_PWD/../..)
export(INSTALLS)
export(dengPacks.files)
export(dengPacks.path)
}
}

deployTarget()

0 comments on commit 6394864

Please sign in to comment.