forked from OpenVR-Advanced-Settings/OpenVR-AdvancedSettings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
advancedSettings.pro
129 lines (101 loc) · 4.15 KB
/
advancedSettings.pro
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
120
121
122
123
124
125
126
127
128
129
QT += core gui qml quick multimedia widgets
CONFIG += c++1z file_copies optimize_full
DEFINES += ELPP_THREAD_SAFE ELPP_QT_LOGGING ELPP_NO_DEFAULT_LOG_FILE
VERSION = "$$cat($$PWD/build_scripts/compile_version_string.txt)"
DEFINES += APPLICATION_VERSION=\\\"$$VERSION\\\"
# Qmake can't handle non-integers in the version string,
# so we take out anything after the dash.
SPLIT_VERSION_STRING = $$split(VERSION, -)
NUMERICAL_VERSION_NUMBER = $$member(SPLIT_VERSION_STRING, 0, 0)
VERSION = $$NUMERICAL_VERSION_NUMBER
# Keep the literal version number in the description field for debugging.
QMAKE_TARGET_DESCRIPTION = "$$cat($$PWD/build_scripts/compile_version_string.txt)"
lessThan(QT_MAJOR_VERSION, 5): error("requires Qt 5.12 or higher")
lessThan(QT_MINOR_VERSION, 12): error("requires Qt 5.12 or higher")
TARGET = AdvancedSettings
TEMPLATE = app
win32:DESTDIR = bin/win64/AdvancedSettings
unix:DESTDIR = bin/linux/AdvancedSettings
include_dir = $$PWD/build_scripts/qt/
win32-msvc {
include($$include_dir/compilers/msvc.pri)
}
win32-clang-msvc{
include($$include_dir/compilers/clang-msvc.pri)
}
*g++* {
include($$include_dir/compilers/gcc.pri)
}
#Look for anything clang that is not clang-msvc, since it does not
#allow all the same switches as regular clang.
*clang|*clang-g++|*clang-libc++ {
include($$include_dir/compilers/clang.pri)
}
include($$include_dir/sources.pri)
include($$include_dir/resources.pri)
# Copy extra files
COPIES += resCopy readmeCopy licenseCopy packageFoldersCopy openvrApiCopy packageFilesCopy
COPY_DEST_DIR = $$OUT_PWD/$$DESTDIR
resCopy.files = $$files(src/res)
resCopy.path = $$COPY_DEST_DIR
readmeCopy.files = Readme.md
readmeCopy.path = $$COPY_DEST_DIR
licenseCopy.files = LICENSE \
third-party/openvr/LICENSE-VALVE \
third-party/easylogging++/LICENSE-MIT
licenseCopy.path = $$COPY_DEST_DIR
packageFoldersCopy.files = src/package_files/default_action_manifests
packageFoldersCopy.path = $$COPY_DEST_DIR
packageFilesCopy.files = src/package_files/action_manifest.json src/package_files/manifest.vrmanifest
win32:packageFilesCopy.files += src/package_files/qt.conf src/package_files/restartvrserver.bat src/package_files/startdesktopmode.bat
packageFilesCopy.path = $$COPY_DEST_DIR
win32:openvrApiCopy.files = third-party/openvr/bin/win64/openvr_api.dll
unix:openvrApiCopy.files = third-party/openvr/lib/linux64/libopenvr_api.so
openvrApiCopy.path = $$COPY_DEST_DIR
# Deploy openssl when on win32
win32 {
COPIES += opensslCopy
opensslCopy.files = third-party/openssl/libcrypto-1_1-x64.dll
opensslCopy.files += third-party/openssl/libssl-1_1-x64.dll
opensslCopy.files += third-party/openssl/LICENSE-OPENSSL
opensslCopy.path = $$COPY_DEST_DIR
}
# Deploy resources and DLLs to exe dir on Windows
win32 {
WINDEPLOYQT_LOCATION = $$dirname(QMAKE_QMAKE)/windeployqt.exe
CONFIG( debug, debug|release ) {
WINDEPLOYQT_BUILD_TARGET += "--debug"
} else {
WINDEPLOYQT_BUILD_TARGET += "--release"
}
WINDEPLOYQT_OPTIONS = --dir $$COPY_DEST_DIR/qtdata \
--libdir $$COPY_DEST_DIR \
--plugindir $$COPY_DEST_DIR/qtdata/plugins \
--no-system-d3d-compiler \
--no-opengl-sw \
$$WINDEPLOYQT_BUILD_TARGET \
--qmldir $$PWD/src/res/qml \
$$COPY_DEST_DIR/AdvancedSettings.exe
WINDEPLOYQT_FULL_LINE = "$$WINDEPLOYQT_LOCATION $$WINDEPLOYQT_OPTIONS"
# Force windeployqt to run in cmd, because powershell has different syntax
# for running executables.
QMAKE_POST_LINK = cmd /c $$WINDEPLOYQT_FULL_LINE
}
# Add make install support
unix {
isEmpty(PREFIX){
PREFIX = /opt/OpenVR-AdvancedSettings
}
message(PREFIX value is: \'$$PREFIX\'. `make install` will install to this location.)
application.path = $$PREFIX
application.files = $$COPY_DEST_DIR
INSTALLS += application
}
debugSymbolsAndLogs {
message(Debug symbols and logging enabled.)
CONFIG += force_debug_info
DEFINES += ENABLE_DEBUG_LOGGING
}
warnings_as_errors {
message(Warnings as errors enabled.)
}