forked from b-com-software-basis/builddefs-qmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
templatelibconfig.pri
executable file
·119 lines (98 loc) · 3.3 KB
/
templatelibconfig.pri
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Author(s) : Loic Touraine, Stephane Leduc
# Manage manifest file
include(bcom_manifest.prf)
TEMPLATE = lib
# Include extended compiler rules
include (bcom_compiler_specs.prf)
staticlib {
LINKMODE = static
} else {
LINKMODE = shared
}
# TODO manage IPP config
CONFIG(debug,debug|release) {
OUTPUTDIR = debug
}
CONFIG(release,debug|release) {
OUTPUTDIR = release
}
TARGETDEPLOYDIR = $${PROJECTDEPLOYDIR}/lib/$${BCOM_TARGET_ARCH}/$${LINKMODE}/$$OUTPUTDIR
unix {
target.path = /usr/lib
LIBPREFIX = lib
DYNLIBEXT = so
LIBEXT = a
}
macx {
LIBPREFIX = lib
DYNLIBEXT = dylib
LIBEXT = a
#NOTE : the following override is mandatory to get a correct install_name in the target library header
#This name ensure later calls of macdylibbundler will correctly work when deploying this library with an executable
QMAKE_LFLAGS_SONAME = -Wl,-install_name,$${TARGETDEPLOYDIR}/
contains(BCOM_TARGET_ARCH, x86_64) {
QMAKE_CFLAGS += -arch x86_64
QMAKE_CXXFLAGS += -arch x86_64
QMAKE_LFLAGS += -arch x86_64
}
contains(BCOM_TARGET_ARCH, i386) {
QMAKE_CFLAGS += -arch i386
QMAKE_CXXFLAGS += -arch i386
QMAKE_LFLAGS += -arch i386
}
}
win32 {
LIBPREFIX = ''
DYNLIBEXT = dll
LIBEXT = lib
# Define macro for handling __declspec(dllexport) for current build target
!staticlib {
DEFINES += $${TARGET}_API_DLLEXPORT
}
# do not add version to target name for shared link mode
CONFIG += skip_target_version_ext
!contains(PROJECTCONFIG,QTVS) {
# qmake processing only 1 time (http://stackoverflow.com/questions/17360553/qmake-processes-my-pro-file-three-times-instead-of-one)
CONFIG -= debug_and_release
}
# multiprocessor build
QMAKE_CXXFLAGS += /MP8
QMAKE_CFLAGS += /MP8
# specify to use the static version of the windows runtime.
# this value must be used only for full static builds as since VS2017, mixing both static and dynamic runtimes at link time is prohibited.
# for mixed libraries link, let qmake set MD also for static configurations.
usestaticwinrt {
QMAKE_CXXFLAGS_DEBUG += -MTd
QMAKE_CXXFLAGS_DEBUG -= -MDd
QMAKE_CFLAGS_DEBUG += -MTd
QMAKE_CFLAGS_DEBUG -= -MDd
QMAKE_CXXFLAGS_RELEASE += -MT
QMAKE_CXXFLAGS_RELEASE -= -MD
QMAKE_CFLAGS_RELEASE += -MT
QMAKE_CFLAGS_RELEASE -= -MD
}
# RC informations
QMAKE_TARGET_COMPANY=b<>com
QMAKE_TARGET_DESCRIPTION=$$TARGET
QMAKE_TARGET_PRODUCT=$$TARGET
# manage copyright
QMAKE_TARGET_COPYRIGHT = $$PRODUCT_BRIEF_COPYRIGHT
isEmpty(QMAKE_TARGET_COPYRIGHT) {
year = $$system("echo %Date:~6,4%")
yearCheck = $$find(year, ^\d{4}$)
yearCheckSize = $$size(yearCheck)
!equals(yearCheckSize,1) {
YEAR = 2019 # default date
}
QMAKE_TARGET_COPYRIGHT=Copyright (c) $$year b<>com
}
}
android {
# Disable default qmake management for installing android libraries
# cf https://martin.rpdev.net/2019/05/21/qt-for-android-installing-a-library-built-with-qmake-into-the-qt-directory.html
CONFIG -= android_install
}
target.path = $${TARGETDEPLOYDIR}
INSTALLS += target
# Parse dependencies if any and fill CFLAGS,CXXFLAGS and LFLAGS
include (packagedependencies.pri)