1
0
mirror of https://github.com/jaredtao/TaoQuick.git synced 2025-02-06 21:48:24 +08:00
2021-04-23 09:53:44 +08:00

44 lines
1.2 KiB
Plaintext

defineTest(useVcpkgLib) {
names=$$eval(1)
isEmpty(names) {
message( names is empty)
return(true)
}
win32 {
vcpkgRoot=$$clean_path($$(VCPKG_ROOT))
vcpkgTriplet=$$(VCPKG_DEFAULT_TRIPLET)
vcpkgInstall=
vcpkgBin=
exists($$vcpkgRoot) {
isEmpty($$vcpkgTriplet) {
equals(QT_ARCH, x86) {
vcpkgTriplet = x86-windows
} else: equals(QT_ARCH, x86_64) {
vcpkgTriplet = x64-windows
}
}
vcpkgInstall=$$vcpkgRoot/installed/$$vcpkgTriplet
}
exists($$vcpkgInstall) {
message(vcpkgInstall $$vcpkgInstall)
INCLUDEPATH += $$vcpkgInstall/include
CONFIG(debug,debug|release){
LIBS += -L$$vcpkgInstall/debug/lib
LIBS += -L$$vcpkgInstall/debug/bin
} else {
LIBS += -L$$vcpkgInstall/lib
LIBS += -L$$vcpkgInstall/bin
}
}
# todo copy dll to destdir
for(libName, names) {
tname = $$qt5LibraryTarget($$libName)
LIBS += -l$$tname
}
export(INCLUDEPATH)
export(LIBS)
}
return(true)
}