Skip to content

Commit

Permalink
Add qmake project for independent build.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Jan 8, 2013
1 parent 09a8c9a commit db38f1e
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 0 deletions.
1 change: 1 addition & 0 deletions mkspecs/features/qtx_config.prf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include(qtx_functions.prf)
22 changes: 22 additions & 0 deletions mkspecs/features/qtx_functions.prf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
defineReplace(qtxPlatformTargetSuffix) {
CONFIG(debug, debug|release) {
!debug_and_release|build_pass {
mac:return(_debug)
win32:return(d)
}
}
return()
}

defineReplace(qtxLibraryTarget) {
unset(LIBRARY_NAME)
LIBRARY_NAME = $$1
mac:!static:contains(CONFIG, framework) {
QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME
export(QMAKE_FRAMEWORK_BUNDLE_NAME)
}
unset(LIBRARY_SUFFIX)
contains(TEMPLATE, .*lib):LIBRARY_SUFFIX = $$qtxPlatformTargetSuffix()
isEmpty(LIBRARY_SUFFIX):return($$LIBRARY_NAME)
else:return($$member(LIBRARY_NAME, 0)$$LIBRARY_SUFFIX)
}
35 changes: 35 additions & 0 deletions mkspecs/features/qtx_module.prf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0)
isEmpty(VERSION):VERSION = $$eval(QTX.$${MODULE}.VERSION)

TEMPLATE = lib
TARGET = $$eval(QTX.$${MODULE}.name)
DESTDIR = $$eval(QTX.$${MODULE}.libs)
TARGET = $$qtxLibraryTarget($$TARGET)

# Build Configurations
#
# By default, the module will be built in release mode. To build in debug mode,
# or both debug and release mode:
#
# $ qmake [options] "CONFIG+=debug"
# $ qmake [options] "CONFIG+=debug_and_release"
#
# To build a static library:
#
# $ qmake [options] "CONFIG+=static"
#
# On Mac OS X, a framework will be created by default. To build a dynamic
# library:
#
# $ qmake [options] "CONFIG+=dylib"

debug_and_release {
CONFIG += build_all
}

mac:!static {
CONFIG += lib_bundle
dylib {
CONFIG -= lib_bundle
}
}
12 changes: 12 additions & 0 deletions mkspecs/features/qtx_parts.prf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
TEMPLATE = subdirs

sub_src.subdir = src
sub_src.target = sub-src
SUBDIRS = sub_src

exists($$_PRO_FILE_PWD_/tests/tests.pro) {
sub_tests.subdir = tests
sub_tests.target = sub-tests
sub_tests.depends = sub_src # The tests may have a run-time only dependency on other parts
SUBDIRS += sub_tests
}
10 changes: 10 additions & 0 deletions mkspecs/features/qtx_testcase.prf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
check.commands += $(TESTRUNNER)

macx {
check.commands += DYLD_LIBRARY_PATH=../../../lib

app_bundle: check.commands += ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET)
else: check.commands += ./$(QMAKE_TARGET)
}

QMAKE_EXTRA_TARGETS *= check
8 changes: 8 additions & 0 deletions mkspecs/test.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include(features/qtx_testcase.prf)


INCLUDEPATH += ../../../src/network

LIBS += -L../../../lib

LIBS += -lQtxNetwork
12 changes: 12 additions & 0 deletions modules/qtx_network.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
QTX.network.MAJOR_VERSION = 0
QTX.network.MINOR_VERSION = 0
QTX.network.PATCH_VERSION = 0
QTX.network.VERSION = $${QTX.network.MAJOR_VERSION}.$${QTX.network.MINOR_VERSION}.$${QTX.network.PATCH_VERSION}

QTX.network.name = QtxNetwork
QTX.network.bins = $$PWD/../bin
QTX.network.includes = $$PWD/../include
QTX.network.sources = $$PWD/../src/version
QTX.network.libs = $$PWD/../lib
QTX.network.plugins = $$PWD/../plugins
QTX.network.imports = $$PWD/../imports
1 change: 1 addition & 0 deletions qtxnetwork.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include(mkspecs/features/qtx_parts.prf)
8 changes: 8 additions & 0 deletions src/network/network.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include(../../modules/qtx_network.pri)
include(../../mkspecs/features/qtx_config.prf)
include(../../mkspecs/features/qtx_module.prf)


QT += network

include(network.pri)
5 changes: 5 additions & 0 deletions src/src.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TEMPLATE = subdirs

SUBDIRS += network
network.subdir = network
network.target = sub-network

0 comments on commit db38f1e

Please sign in to comment.