Skip to content

Commit eaf03a7

Browse files
committed
Add qmake project for standalone builds.
1 parent 46fe87d commit eaf03a7

File tree

10 files changed

+112
-0
lines changed

10 files changed

+112
-0
lines changed

mkspecs/features/qtx_config.prf

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include(qtx_functions.prf)

mkspecs/features/qtx_functions.prf

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
defineReplace(qtxPlatformTargetSuffix) {
2+
CONFIG(debug, debug|release) {
3+
!debug_and_release|build_pass {
4+
mac:return(_debug)
5+
win32:return(d)
6+
}
7+
}
8+
return()
9+
}
10+
11+
defineReplace(qtxLibraryTarget) {
12+
unset(LIBRARY_NAME)
13+
LIBRARY_NAME = $$1
14+
mac:!static:contains(CONFIG, framework) {
15+
QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME
16+
export(QMAKE_FRAMEWORK_BUNDLE_NAME)
17+
}
18+
unset(LIBRARY_SUFFIX)
19+
contains(TEMPLATE, .*lib):LIBRARY_SUFFIX = $$qtxPlatformTargetSuffix()
20+
isEmpty(LIBRARY_SUFFIX):return($$LIBRARY_NAME)
21+
else:return($$member(LIBRARY_NAME, 0)$$LIBRARY_SUFFIX)
22+
}

mkspecs/features/qtx_module.prf

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0)
2+
isEmpty(VERSION):VERSION = $$eval(QTX.$${MODULE}.VERSION)
3+
4+
TEMPLATE = lib
5+
TARGET = $$eval(QTX.$${MODULE}.name)
6+
DESTDIR = $$eval(QTX.$${MODULE}.libs)
7+
TARGET = $$qtxLibraryTarget($$TARGET)
8+
9+
# Build Configurations
10+
#
11+
# By default, the module will be built in release mode. To build in debug mode,
12+
# or both debug and release mode:
13+
#
14+
# $ qmake [options] "CONFIG+=debug"
15+
# $ qmake [options] "CONFIG+=debug_and_release"
16+
#
17+
# To build a static library:
18+
#
19+
# $ qmake [options] "CONFIG+=static"
20+
#
21+
# On Mac OS X, a framework will be created by default. To build a dynamic
22+
# library:
23+
#
24+
# $ qmake [options] "CONFIG+=dylib"
25+
26+
debug_and_release {
27+
CONFIG += build_all
28+
}
29+
30+
mac:!static {
31+
CONFIG += lib_bundle
32+
dylib {
33+
CONFIG -= lib_bundle
34+
}
35+
}

mkspecs/features/qtx_parts.prf

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
TEMPLATE = subdirs
2+
3+
sub_src.subdir = src
4+
sub_src.target = sub-src
5+
SUBDIRS = sub_src
6+
7+
exists($$_PRO_FILE_PWD_/tests/tests.pro) {
8+
sub_tests.subdir = tests
9+
sub_tests.target = sub-tests
10+
sub_tests.depends = sub_src # The tests may have a run-time only dependency on other parts
11+
SUBDIRS += sub_tests
12+
}

mkspecs/features/qtx_testcase.prf

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
check.commands += $(TESTRUNNER)
2+
3+
macx {
4+
check.commands += DYLD_LIBRARY_PATH=../../../lib
5+
6+
app_bundle: check.commands += ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET)
7+
else: check.commands += ./$(QMAKE_TARGET)
8+
}
9+
10+
QMAKE_EXTRA_TARGETS *= check

mkspecs/test.pri

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include(features/qtx_testcase.prf)
2+
3+
4+
INCLUDEPATH += ../../../src/update
5+
6+
LIBS += -L../../../lib
7+
8+
LIBS += -lQtxUpdate

modules/qtx_update.pri

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
QTX.update.MAJOR_VERSION = 0
2+
QTX.update.MINOR_VERSION = 0
3+
QTX.update.PATCH_VERSION = 0
4+
QTX.update.VERSION = $${QTX.update.MAJOR_VERSION}.$${QTX.update.MINOR_VERSION}.$${QTX.update.PATCH_VERSION}
5+
6+
QTX.update.name = QtxVersion
7+
QTX.update.bins = $$PWD/../bin
8+
QTX.update.includes = $$PWD/../include
9+
QTX.update.sources = $$PWD/../src/version
10+
QTX.update.libs = $$PWD/../lib
11+
QTX.update.plugins = $$PWD/../plugins
12+
QTX.update.imports = $$PWD/../imports

qtxupdate.pro

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include(mkspecs/features/qtx_parts.prf)

src/src.pro

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
TEMPLATE = subdirs
2+
3+
SUBDIRS += update
4+
update.subdir = update
5+
update.target = sub-update

src/update/update.pro

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include(../../modules/qtx_update.pri)
2+
include(../../mkspecs/features/qtx_config.prf)
3+
include(../../mkspecs/features/qtx_module.prf)
4+
5+
6+
include(update.pri)

0 commit comments

Comments
 (0)