Skip to content

Commit

Permalink
Working on qmake project files
Browse files Browse the repository at this point in the history
Building and bundling dehread, wadmapconverter and doom on Mac.
  • Loading branch information
skyjake committed Sep 11, 2011
1 parent 38c0397 commit 8fd406e
Show file tree
Hide file tree
Showing 13 changed files with 411 additions and 60 deletions.
2 changes: 1 addition & 1 deletion doomsday/build/mac/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.9.0</string>
<string>1.9.7</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Expand Down
25 changes: 25 additions & 0 deletions doomsday/build/mac/bundleapp.sh
@@ -0,0 +1,25 @@
#!/bin/sh
# Helper script for bundling the application on OS X

echo "Bundling Doomsday.app..."

CP="cp -fRp"

SRCDIR=$1
echo "Source directory: $SRCDIR"

BUILDDIR=engine

mv $BUILDDIR/doomsday.app $BUILDDIR/Doomsday.app

APPDIR=$BUILDDIR/Doomsday.app/Contents
echo "Bundle directory: $APPDIR"

echo "Clearing existing bundles..."
rm -rf $BUILDDIR/*.bundle

echo "Copying bundles from plugins..."
$CP plugins/dehread/dpDehRead.bundle $BUILDDIR/dpDehRead.bundle
$CP plugins/wadmapconverter/dpWadMapConverter.bundle $BUILDDIR/dpWadMapConverter.bundle

echo "Bundling done."
66 changes: 66 additions & 0 deletions doomsday/config.pri
@@ -0,0 +1,66 @@
QT -= core gui

include(versions.pri)

message(Doomsday version $${DENG_VERSION}.)

# Debug/release build selection.
CONFIG(debug, debug|release) {
message("Debug build.")
DEFINES += _DEBUG
DENG_CONFIG += rangecheck
} else {
message("Release build.")
DEFINES += NDEBUG
}

win32 {
DEFINES += WIN32
}
unix {
DEFINES += UNIX

# We are not interested in unused parameters (there are quite a few).
QMAKE_CFLAGS_WARN_ON += \
-Wno-unused-parameter \
-Wno-unused-variable \
-Wno-missing-field-initializers \
-Wno-missing-braces
}
macx {
DEFINES += MACOSX

QMAKE_LFLAGS += -flat_namespace -undefined suppress

DENG_CONFIG += snowleopard nofixedasm

# Select OS version.
contains(DENG_CONFIG, snowleopard) {
message("Using Mac OS 10.6 SDK (Universal 32/64-bit, no PowerPC binary).")
QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.6.sdk
CONFIG += x86 x86_64
}
else {
message("Using Mac OS 10.4 SDK (Universal 32-bit Intel/PowerPC binary.)")
QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.4u.sdk
CONFIG += x86 ppc
}
}

# Directories ----------------------------------------------------------------

DENG_API_DIR = $$PWD/engine/api
DENG_INCLUDE_DIR = $$PWD/engine/portable/include
DENG_UNIX_INCLUDE_DIR = $$PWD/engine/unix/include
DENG_MAC_INCLUDE_DIR = $$PWD/engine/mac/include
DENG_WIN_INCLUDE_DIR = $$PWD/engine/win32/include
DENG_LZSS_DIR = $$PWD/external/lzss

# Apply DENG_CONFIG ----------------------------------------------------------

contains(DENG_CONFIG, nofixedasm) {
DEFINES += NO_FIXED_ASM
}
!contains(DENG_CONFIG, rangecheck) {
DEFINES += NORANGECHECKING
}
1 change: 1 addition & 0 deletions doomsday/doomsday.pro
Expand Up @@ -2,4 +2,5 @@
# Copyright (c) 2011 Jaakko Keränen <jaakko.keranen@iki.fi>

TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = engine plugins
82 changes: 25 additions & 57 deletions doomsday/engine/engine.pro
Expand Up @@ -3,28 +3,12 @@

TEMPLATE = app
TARGET = doomsday
QT -= core gui

# Build Configuration --------------------------------------------------------

VERSION = 1.9.7
include(../config.pri)

# TODO: import deng config from a .pri file
macx {
DENG_CONFIG += snowleopard nofixedasm

# Select OS version.
contains(DENG_CONFIG, snowleopard) {
message("Using Mac OS 10.6 SDK (Universal 32/64-bit, no PowerPC binary).")
QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.6.sdk
CONFIG += x86 x86_64
}
else {
message("Using Mac OS 10.4 SDK (Universal 32-bit Intel/PowerPC binary.)")
QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.4u.sdk
CONFIG += x86 ppc
}
}
VERSION = $$DENG_VERSION

# External Dependencies ------------------------------------------------------

Expand All @@ -40,44 +24,15 @@ include(../curl.pri)
DEFINES += __DOOMSDAY__
contains(QMAKE_HOST.arch, x86_64) {
message("64-bit architecture detected.")
#DEFINES += __x86_64__
}
debug {
message("Debug build.")
DEFINES += _DEBUG
}
win32 {
DEFINES += WIN32
}
unix {
DEFINES += UNIX

# We are not interested in unused parameters (there are quite a few).
QMAKE_CFLAGS_WARN_ON += \
-Wno-unused-parameter \
-Wno-unused-variable \
-Wno-missing-field-initializers
DEFINES += HOST_IS_64BIT
}
macx {
DEFINES += MACOSX

LIBS += -framework Cocoa -framework QTKit

QMAKE_CFLAGS += -undefined suppress
QMAKE_CXXFLAGS += -undefined suppress

INSTALLS += embedded_frameworks
embedded_frameworks.path = $$OUT_PWD/doomsday.app/Contents/Frameworks
embedded_frameworks.files = \
$${SDL_FRAMEWORK_DIR}/SDL.framework \
$${SDL_FRAMEWORK_DIR}/SDL_mixer.framework
}

# Engine Configuration -------------------------------------------------------

contains(DENG_CONFIG, nofixedasm) {
DEFINES += NO_FIXED_ASM

# Use the fixed-point math from libcommon.
# TODO: Move it to the engine.
SOURCES += ../plugins/common/src/m_fixed.c
Expand All @@ -86,15 +41,6 @@ contains(DENG_CONFIG, writertypecheck) {
DEFINES += DENG_WRITER_TYPECHECK
}

# Directories ----------------------------------------------------------------

DENG_API_DIR = api
DENG_INCLUDE_DIR = portable/include
DENG_UNIX_INCLUDE_DIR = unix/include
DENG_MAC_INCLUDE_DIR = mac/include
DENG_WIN_INCLUDE_DIR = win32/include
DENG_LZSS_DIR = ../external/lzss

# Source Files ---------------------------------------------------------------

DENG_API_HEADERS = \
Expand Down Expand Up @@ -506,3 +452,25 @@ SOURCES += \
unix {
SOURCES += $$DENG_UNIX_SOURCES
}

# Resources ------------------------------------------------------------------

macx {
sdl_frameworks.files = \
$${SDL_FRAMEWORK_DIR}/SDL.framework \
$${SDL_FRAMEWORK_DIR}/SDL_mixer.framework
sdl_frameworks.path = Contents/Frameworks

res.files = \
mac/res/English.lproj \
mac/res/Startup.nib \
mac/res/deng.icns
res.path = Contents/Resources

packdata.files = $$OUT_PWD/../doomsday.pk3
packdata.path = Contents/Resources

QMAKE_BUNDLE_DATA += sdl_frameworks res packdata

QMAKE_INFO_PLIST = ../build/mac/Info.plist
}
111 changes: 111 additions & 0 deletions doomsday/plugins/common/common.pri
@@ -0,0 +1,111 @@
# The Doomsday Engine Project
# Copyright (c) 2011 Jaakko Keränen <jaakko.keranen@iki.fi>

common_inc = $$PWD/include
common_src = $$PWD/src

INCLUDEPATH += \
$$common_inc \
$$DENG_LZSS_DIR/portable/include

HEADERS += \
$$common_inc/am_map.h \
$$common_inc/common.h \
$$common_inc/d_net.h \
$$common_inc/d_netcl.h \
$$common_inc/d_netsv.h \
$$common_inc/dmu_lib.h \
$$common_inc/f_infine.h \
$$common_inc/g_common.h \
$$common_inc/g_controls.h \
$$common_inc/g_defs.h \
$$common_inc/g_eventsequence.h \
$$common_inc/g_update.h \
$$common_inc/hu_inventory.h \
$$common_inc/hu_lib.h \
$$common_inc/hu_log.h \
$$common_inc/hu_menu.h \
$$common_inc/hu_msg.h \
$$common_inc/hu_pspr.h \
$$common_inc/hu_stuff.h \
$$common_inc/m_argv.h \
$$common_inc/m_defs.h \
$$common_inc/p_actor.h \
$$common_inc/p_automap.h \
$$common_inc/p_ceiling.h \
$$common_inc/p_door.h \
$$common_inc/p_floor.h \
$$common_inc/p_inventory.h \
$$common_inc/p_iterlist.h \
$$common_inc/p_map.h \
$$common_inc/p_mapsetup.h \
$$common_inc/p_mapspec.h \
$$common_inc/p_plat.h \
$$common_inc/p_player.h \
$$common_inc/p_saveg.h \
$$common_inc/p_start.h \
$$common_inc/p_svtexarc.h \
$$common_inc/p_switch.h \
$$common_inc/p_terraintype.h \
$$common_inc/p_tick.h \
$$common_inc/p_user.h \
$$common_inc/p_view.h \
$$common_inc/p_xg.h \
$$common_inc/p_xgline.h \
$$common_inc/p_xgsec.h \
$$common_inc/r_common.h \
$$common_inc/rend_automap.h \
$$common_inc/st_lib.h \
$$common_inc/x_hair.h \
$$common_inc/xgclass.h

SOURCES += \
$$common_src/am_map.c \
$$common_src/d_net.c \
$$common_src/d_netcl.c \
$$common_src/d_netsv.c \
$$common_src/dmu_lib.c \
$$common_src/f_infine.c \
$$common_src/g_controls.c \
$$common_src/g_defs.c \
$$common_src/g_eventsequence.c \
$$common_src/g_game.c \
$$common_src/g_update.c \
$$common_src/hu_inventory.c \
$$common_src/hu_lib.c \
$$common_src/hu_log.c \
$$common_src/hu_menu.c \
$$common_src/hu_msg.c \
$$common_src/hu_pspr.c \
$$common_src/hu_stuff.c \
$$common_src/m_ctrl.c \
$$common_src/m_fixed.c \
$$common_src/m_multi.c \
$$common_src/p_actor.c \
$$common_src/p_automap.c \
$$common_src/p_ceiling.c \
$$common_src/p_door.c \
$$common_src/p_floor.c \
$$common_src/p_inventory.c \
$$common_src/p_iterlist.c \
$$common_src/p_map.c \
$$common_src/p_mapsetup.c \
$$common_src/p_mapspec.c \
$$common_src/p_plat.c \
$$common_src/p_player.c \
$$common_src/p_saveg.c \
$$common_src/p_start.c \
$$common_src/p_svtexarc.c \
$$common_src/p_switch.c \
$$common_src/p_terraintype.c \
$$common_src/p_tick.c \
$$common_src/p_user.c \
$$common_src/p_view.c \
$$common_src/p_xgfile.c \
$$common_src/p_xgline.c \
$$common_src/p_xgsave.c \
$$common_src/p_xgsec.c \
$$common_src/r_common.c \
$$common_src/rend_automap.c \
$$common_src/st_lib.c \
$$common_src/x_hair.c
11 changes: 11 additions & 0 deletions doomsday/plugins/config.pri
@@ -0,0 +1,11 @@
# The Doomsday Engine Project
# Copyright (c) 2011 Jaakko Keränen <jaakko.keranen@iki.fi>

include(../config.pri)

macx {
CONFIG += lib_bundle
QMAKE_BUNDLE_EXTENSION = .bundle
}

INCLUDEPATH += $$DENG_API_DIR
11 changes: 11 additions & 0 deletions doomsday/plugins/dehread/dehread.pro
@@ -0,0 +1,11 @@
# The Doomsday Engine Project
# Copyright (c) 2011 Jaakko Keränen <jaakko.keranen@iki.fi>

include(../pluginconfig.pri)

TEMPLATE = lib
TARGET = dpdehread

HEADERS += include/version.h

SOURCES += src/dehmain.c

0 comments on commit 8fd406e

Please sign in to comment.