-
Notifications
You must be signed in to change notification settings - Fork 25
/
conf.pri.example
227 lines (194 loc) · 8.38 KB
/
conf.pri.example
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# Note:
# All conf.pri.example files (they are 4) contain a lot of commented code, personally,
# I wouldn't say I like these comments, especially after the Auto-configuration feature
# was added.
# But these comments show all possible alternatives to configure TinyORM project so
# you can quickly find out what you can use.
# Choose any method you like and remove the rest of commented code.
# Auto-configuration
# ---
# The Auto-configuration feature and tiny_dotenv qmake CONFIG were added in the TinyORM v0.34.0.
# These new features allow us to auto-configure TinyORM project, and with their help,
# the conf.pri files can be skipped entirely.
#
# The Auto-configuration feature is designed to find the vcpkg and MySQL installations, and
# tiny_dotenv to include the .env and .env.$$QMAKE_PLATFORM files in the project's root folder.
# These new features can be configured using qmake and environment variables, and they
# also contain some guessing logic if these variables are not defined.
#
# These are qmake and environment variables that affect the Auto-configuration feature:
#
# - TINY_VCPKG_ROOT - Path to the vcpkg installation folder.
# If not defined, then it tries to use the VCPKG_ROOT environment
# variable.
# - TINY_VCPKG_TRIPLET - The vcpkg triplet to use (vcpkg/installed/$$TINY_VCPKG_TRIPLET/).
# If not defined, then it tries to guess the vcpkg triplet based
# on the current compiler and OS (based on the QMAKESPEC), and
# as the last thing, it tries to use the VCPKG_DEFAULT_TRIPLET
# environment variable.
# - TINY_MYSQL_ROOT - Path to the MySQL installation folder.
# If not defined, then it tries to guess the MySQL installation folder:
# $$(ProgramFiles)/MySQL/MySQL Server (9.0|8.4|8.3|8.2|8.1|8.0|5.7)/)
#
# You can set these variables in the .env (recommended) or conf.pri files,
# in the .qmake.conf file (or wherever you want), or as environment variables.
#
# These variables will be set after auto-configuration is done:
#
# - TINY_VCPKG_INCLUDE - Path to the vcpkg include folder (vcpkg/installed/<triplet>/include/).
# - TINY_MYSQL_INCLUDE - Path to the MySQL include folder (MySQL Server 9.0/include/).
# - TINY_MYSQL_LIB - Path to the MySQL lib folder (MySQL Server 9.0/lib/).
#
# The TINY_MYSQL_INCLUDE and TINY_MYSQL_LIB are only set on win32 platform except mingw.
# .env and .env.$$TINY_DOTENV_PLATFORM (tiny_dotenv feature)
# ---
#
# This feature allows us to define the .env and .env.$$TINY_DOTENV_PLATFORM files
# in the project's root folder. These files are loaded as early as possible so you can
# affect the qmake configuration process. On the other hand, the conf.pri files are
# loaded as late as possible, and they can be used to override the qmake configuration.
#
# The .env file is included first and is included on all platforms.
#
# There is only one requirement for this feature to work correctly, and that is to set
# the TINY_DOTENV_ROOT qmake variable to the project's root folder. This variable is
# already set in the .qmake.conf file for the TinyORM project.
#
# Then the following names are taken into account: .env, .env.win32, .env.unix, .env.mingw
# Tom migrations
# ---
# Default migrations path as the string for the make:migration command
# The path can be absolute or relative (to the pwd at runtime)
# It will look like this on the cmd. line: -DTINYTOM_MIGRATIONS_DIR="<path>/<path>"
# If the path doesn't contain a space then the \" is not needed
# Will be stringified in the tom/application.cpp
#DEFINES += TINYTOM_MIGRATIONS_DIR="\"database/migrations\""
# Default models path as the string for the make:model command
#DEFINES += TINYTOM_MODELS_DIR="\"database/models\""
# Default seeders path as the string for the make:seeder command
#DEFINES += TINYTOM_SEEDERS_DIR="\"database/seeders\""
# Dependencies include and library paths
# ---
# MySQL C library
# Arch - pacman -S mariadb-libs
# Gentoo - emerge dev-db/mysql (package.use: -server -perl)
# Ubuntu - apt install libmysqlclient-dev
# range-v3 library (header only)
# Arch - pacman -S range-v3
# Gentoo - emerge dev-cpp/range-v3
# Ubuntu - apt install librange-v3-dev
# ccache
# Arch - pacman -S ccache
# Gentoo - emerge dev-util/ccache
# Ubuntu - apt install ccache
disable_autoconf {
# load(private/tiny_system_includepath)
load(private/tiny_find_packages)
}
# MinGW
win32-g++|win32-clang-g++ {
# Enable ccache wrapper
# CONFIG *= ccache
# Use alternative linker (for both GCC and Clang)
# CONFIG *= use_lld_linker does not work on MinGW
# QMAKE_LFLAGS *= -fuse-ld=lld
# Nothing to do, auto-configuration is enabled
!disable_autoconf: return()
# Includes and Libraries
# vcpkg - range-v3 and tabulate
tiny_find_vcpkg()
# tiny_find_vcpkg($$quote(C:/msys64/home/xyz/Code/vcpkg/), x64-mingw-dynamic)
# tiny_add_system_includepath(\
# $$quote(C:/msys64/home/xyz/Code/vcpkg/installed/x64-mingw-dynamic/include/))
# MariaDB C library
# On MSYS2 there is only the MariaDB C library (no MySQL C library)
mysql_ping {
# Find the MySQL C library and add it on system include path and library path
tiny_find_mysql()
# Shared build - find with the pkg-config (preferred)
# CONFIG(shared, dll|shared|static|staticlib) | \
# CONFIG(dll, dll|shared|static|staticlib) {
# !link_pkgconfig_off {
# CONFIG *= link_pkgconfig
# PKGCONFIG *= libmariadb
# }
# else: \
# LIBS_PRIVATE += -lmariadb
# }
# # Static build
# else: \
# if(CONFIG(static, dll|shared|static|staticlib) | \
# CONFIG(staticlib, dll|shared|static|staticlib)): \
# LIBS_PRIVATE += -lmariadb.dll
# Or add manually (use only one method, above or this manual method)
# # For shared build
# LIBS_PRIVATE += -lmariadb
# # For static build
# LIBS_PRIVATE += -lmariadb.dll
}
}
# Windows (excluding MinGW)
else:win32-msvc|win32-clang-msvc {
# Enable ccache wrapper
# CONFIG *= ccache
# Nothing to do, auto-configuration is enabled
!disable_autoconf: return()
# Explicitly specify the MySQL root installation path using the $$TINY_MYSQL_ROOT
# !disable_autoconf {
# # Used in the tiny_find_mysql()
# TINY_MYSQL_ROOT = $$quote($$(ProgramFiles)/MySQL/MySQL Server 9.0/)
# return()
# }
# Includes and Libraries
# vcpkg - range-v3 and tabulate
tiny_find_vcpkg()
# tiny_find_vcpkg($$quote(E:/xyz/vcpkg/), x64-windows)
# tiny_add_system_includepath($$quote(E:/xyz/vcpkg/installed/x64-windows/include/))
# MySQL C library
mysql_ping {
# Find the MySQL C library and add it on system include path and library path
tiny_find_mysql()
# tiny_find_mysql($$quote($$(ProgramFiles)/MySQL/MySQL Server 9.0/))
# tiny_add_system_includepath(\
# $$quote(C:/Program Files/MySQL/MySQL Server 9.0/include/))
# LIBS_PRIVATE += $$quote(-LC:/Program Files/MySQL/MySQL Server 9.0/lib/)
# LIBS_PRIVATE += -llibmysql
}
}
# Unix
else:unix {
# Use LLD linker for Clang
clang: CONFIG *= use_lld_linker
else: CONFIG *= use_gold_linker
# Or use the mold linker
# QMAKE_LFLAGS *= -fuse-ld=mold
# Nothing to do, auto-configuration is enabled
!disable_autoconf: return()
# Includes and Libraries
# vcpkg - range-v3 and tabulate
tiny_find_vcpkg()
# tiny_find_vcpkg($$quote(/home/xyz/Code/c/vcpkg/installed/x64-linux/include/), \
# x64-linux)
# tiny_add_system_includepath(\
# $$quote(/home/xyz/Code/c/vcpkg/installed/x64-linux/include/))
# MySQL C library
mysql_ping {
# Find the MySQL C library and add it on system include path and library path
tiny_find_mysql()
# Find with pkg-config (preferred)
# !link_pkgconfig_off {
# CONFIG *= link_pkgconfig
# # Pick only one
# PKGCONFIG *= mysqlclient
## PKGCONFIG *= libmariadb
# }
# else: \
# # Pick only one
# LIBS_PRIVATE += -lmysqlclient
## LIBS_PRIVATE += -lmariadb
# Or add manually (use only one method, above or this manual method)
# Pick only one
# LIBS_PRIVATE += -lmysqlclient
# LIBS_PRIVATE += -lmariadb
}
}