-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindASSIMP.cmake
102 lines (92 loc) · 2.81 KB
/
FindASSIMP.cmake
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
# Based on the FindPhysFS.cmake scipt
# - Try to find Assimp
# Once done this will define
#
# ASSIMP_FOUND - system has Assimp
# ASSIMP_INCLUDE_DIR - the Assimp include directory
# ASSIMP_LIBRARY - Link these to use Assimp
set(_assimp_INCLUDE_SEARCH_DIRS_SYSTEM
C:/assimp/include
C:/assimp
"$ENV{ProgramFiles}/assimp/include"
"$ENV{ProgramFiles}/assimp"
/sw/local/include
)
set(_assimp_LIB_SEARCH_DIRS_SYSTEM
C:/assimp/lib
C:/assimp
"$ENV{ProgramFiles}/assimp/lib"
"$ENV{ProgramFiles}/assimp"
/sw/local/lib
)
FIND_PATH(ASSIMP_INCLUDE_DIR assimp/ai_assert.h
$ENV{ASSIMPSDIR}/include
$ENV{ASSIMPSDIR}
$ENV{ASSIMPSDIR}/..
~/Library/Frameworks/AssImp.framework/Headers
/Library/Frameworks/AssImp.framework/Headers
/usr/local/include/assimp
/usr/local/include
/usr/include/assimp
/usr/include
/sw/include/assimp # Fink
/sw/include
/opt/local/include/assimp # DarwinPorts
/opt/local/include
/opt/csw/include/assimp # Blastwave
/opt/csw/include
/opt/include/assimp
/opt/include
${_assimp_INCLUDE_SEARCH_DIRS_SYSTEM}
)
# FIND_LIBRARY(ASSIMP_LIBRARY_DEBUG
# NAMES assimpD
# PATHS
# $ENV{ASSIMPSDIR}/lib
# /usr/local/lib
# /usr/lib
# /sw/lib
# /opt/local/lib
# /opt/csw/lib
# /opt/lib
# ${_assimp_LIB_SEARCH_DIRS_SYSTEM}
# )
FIND_LIBRARY(ASSIMP_LIBRARY_RELEASE
NAMES assimp
PATHS
$ENV{ASSIMPSDIR}/lib
$ENV{ASSIMPSDIR}/lib64
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/sw/lib64
/opt/local/lib
/opt/local/lib64
/opt/csw/lib
/opt/csw/lib64
/opt/lib
/opt/lib64
${_assimp_LIB_SEARCH_DIRS_SYSTEM}
)
SET(ASSIMP_FOUND "NO")
# IF(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARY_DEBUG AND ASSIMP_LIBRARY_RELEASE)
IF(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARY_RELEASE)
SET(ASSIMP_FOUND "YES")
SET(ASSIMP_LIBRARY ${ASSIMP_LIBRARY_RELEASE})
ENDIF(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARY_RELEASE)
# ENDIF(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARY_DEBUG AND ASSIMP_LIBRARY_RELEASE)
if(ASSIMP_DEBUG)
message(STATUS "assimp inc: ${ASSIMP_INCLUDE_DIR}")
message(STATUS "assimp lib: ${ASSIMP_LIBRARY}")
ENDIF(ASSIMP_DEBUG)
if(ASSIMP_FIND_REQUIRED AND NOT (ASSIMP_LIBRARY AND ASSIMP_INCLUDE_DIR))
message(FATAL_ERROR "Could not find assimp")
ENDIF(ASSIMP_FIND_REQUIRED AND NOT (ASSIMP_LIBRARY AND ASSIMP_INCLUDE_DIR))
mark_as_advanced(ASSIMP_LIBRARY_DEBUG ASSIMP_LIBRARY_RELEASE ASSIMP_INCLUDE_DIR)
if (ASSIMP_FOUND)
message(STATUS "Found ASSIMP: ${ASSIMP_LIBRARY}")
else()
message(STATUS "ASSIMP not found!")
endif(ASSIMP_FOUND)