/
dep_assimp.pri
76 lines (68 loc) · 2.16 KB
/
dep_assimp.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
# Open Asset Import Library
aiOpts = ""
aiIncDir = ""
aiLibs = ""
deng_extassimp {
ASSIMP_DIR = $$PWD/external/assimp
}
!isEmpty(ASSIMP_DIR) {
!win32 {
aiIncDir = $$ASSIMP_DIR/include
aiLibs = -L$$ASSIMP_DIR/lib -lassimp
deng_extassimp {
*-g*|*-clang* {
# Inform the dynamic linker about a custom location.
QMAKE_LFLAGS += -Wl,-rpath,$$DENG_PLUGIN_LIB_DIR
}
# Install the custom-build external Assimp.
INSTALLS += assimplib
assimplib.files = $$ASSIMP_DIR/lib/libassimp.so.3
assimplib.path = $$DENG_PLUGIN_LIB_DIR
}
else {
*-g*|*-clang* {
# Inform the dynamic linker about a custom location.
QMAKE_LFLAGS += -Wl,-rpath,$$ASSIMP_DIR/lib
}
}
}
else {
# On Windows we assume that cmake has been run in the root of
# the assimp source tree.
aiIncDir = $$ASSIMP_DIR/include
deng_msvc {
deng_debug: aiLibs = -L$$ASSIMP_DIR/lib/debug -lassimpd
else: aiLibs = -L$$ASSIMP_DIR/lib/release -lassimp
}
else {
aiLibs = -L$$ASSIMP_DIR/lib -lassimp
}
INSTALLS += assimplib
assimplib.path = $$DENG_BIN_DIR
deng_debug: assimplib.files = $$ASSIMP_DIR/bin/debug/assimpd.dll
else: assimplib.files = $$ASSIMP_DIR/bin/release/assimp.dll
}
}
else:!macx:!win32 {
# Are the development files installed?
!system(pkg-config --exists assimp) {
error(Missing dependency: Open Asset Import Library)
}
aiOpts = $$system(pkg-config --cflags assimp)
aiLibs = $$system(pkg-config --libs assimp)
}
else {
error(Open Asset Import Library location not defined (ASSIMP_DIR))
}
INCLUDEPATH += $$aiIncDir
QMAKE_CFLAGS += $$aiOpts
QMAKE_CXXFLAGS += $$aiOpts
LIBS += $$aiLibs
macx {
defineTest(linkBinaryToBundledAssimp) {
# 1: binary
# 2: relative path to Frameworks
doPostLink(install_name_tool -change "$$ASSIMP_DIR/lib/libassimp.3.dylib" \
"@rpath/libassimp.3.dylib" "$$1")
}
}