2 # Find the DirectSound includes and libraries
\r
4 # MAXSDK_DIR - 3DSMAX SDK root directory
\r
5 # MAXSDK_INCLUDE_DIR - where to find baseinterface.h
\r
6 # MAXSDK_LIBRARIES - List of libraries when using 3DSMAX.
\r
7 # MAXSDK_FOUND - True if MAX SDK found.
\r
9 if(MAXSDK_INCLUDE_DIR)
\r
10 # Already in cache, be silent
\r
11 SET(MAXSDK_FIND_QUIETLY TRUE)
\r
14 set(_pf_x86 "PROGRAMFILES(x86)")
\r
16 FIND_PATH(MAXSDK_DIR
\r
17 "include/maxversion.h"
\r
21 "$ENV{ADSK_3DSMAX_SDK_2021}/maxsdk"
\r
22 "$ENV{ADSK_3DSMAX_SDK_2020}/maxsdk"
\r
23 "$ENV{ADSK_3DSMAX_SDK_2019}/maxsdk"
\r
24 "$ENV{ADSK_3DSMAX_SDK_2018}/maxsdk"
\r
25 "$ENV{ADSK_3DSMAX_SDK_2017}/maxsdk"
\r
26 "$ENV{ADSK_3DSMAX_SDK_2016}/maxsdk"
\r
27 "$ENV{ADSK_3DSMAX_SDK_2015}/maxsdk"
\r
28 "$ENV{ADSK_3DSMAX_SDK_2014}/maxsdk"
\r
29 "$ENV{ADSK_3DSMAX_SDK_2013}/maxsdk"
\r
30 "$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk"
\r
31 "$ENV{3DSMAX_2011_SDK_PATH}/maxsdk"
\r
32 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2021 SDK/maxsdk"
\r
33 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2020 SDK/maxsdk"
\r
34 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2019 SDK/maxsdk"
\r
35 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2018 SDK/maxsdk"
\r
36 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2017 SDK/maxsdk"
\r
37 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2016 SDK/maxsdk"
\r
38 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2015 SDK/maxsdk"
\r
39 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2014 SDK/maxsdk"
\r
40 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2013 SDK/maxsdk"
\r
41 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2012 SDK/maxsdk"
\r
42 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2011 SDK/maxsdk"
\r
43 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2010 SDK/maxsdk"
\r
44 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2009 SDK/maxsdk"
\r
45 "$ENV{${_pf_x86}}/Autodesk/3ds Max 2008 SDK/maxsdk"
\r
46 "$ENV{${_pf_x86}}/Autodesk/3ds Max 9 SDK/maxsdk"
\r
47 "$ENV{${_pf_x86}}/Autodesk/3dsMax8/maxsdk"
\r
48 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2021 SDK/maxsdk"
\r
49 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2020 SDK/maxsdk"
\r
50 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2019 SDK/maxsdk"
\r
51 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2018 SDK/maxsdk"
\r
52 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2017 SDK/maxsdk"
\r
53 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2016 SDK/maxsdk"
\r
54 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2015 SDK/maxsdk"
\r
55 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2014 SDK/maxsdk"
\r
56 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2013 SDK/maxsdk"
\r
57 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2012 SDK/maxsdk"
\r
58 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2011 SDK/maxsdk"
\r
59 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk"
\r
60 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk"
\r
61 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk"
\r
62 "$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk"
\r
63 "$ENV{PROGRAMFILES}/Autodesk/3dsMax8/maxsdk"
\r
66 FIND_PATH(MAXSDK_INCLUDE_DIR
\r
69 ${MAXSDK_DIR}/include
\r
72 FIND_PATH(MAXSDK_CS_INCLUDE_DIR bipexp.h
\r
74 ${MAXSDK_DIR}/include/CS
\r
78 SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib ${MAXSDK_DIR}/lib/x64/Release)
\r
80 SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/lib)
\r
83 MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
\r
84 FIND_LIBRARY(${MYLIBRARY}
\r
85 NAMES ${MYLIBRARYNAME}
\r
87 ${MAXSDK_LIBRARY_DIRS}
\r
91 FIND_3DS_LIBRARY(MAXSDK_CORE_LIBRARY core)
\r
92 FIND_3DS_LIBRARY(MAXSDK_GEOM_LIBRARY geom)
\r
93 FIND_3DS_LIBRARY(MAXSDK_GFX_LIBRARY gfx)
\r
94 FIND_3DS_LIBRARY(MAXSDK_MESH_LIBRARY mesh)
\r
95 FIND_3DS_LIBRARY(MAXSDK_MAXUTIL_LIBRARY maxutil)
\r
96 FIND_3DS_LIBRARY(MAXSDK_MAXSCRIPT_LIBRARY maxscrpt)
\r
97 FIND_3DS_LIBRARY(MAXSDK_PARAMBLK2_LIBRARY paramblk2)
\r
98 FIND_3DS_LIBRARY(MAXSDK_BMM_LIBRARY bmm)
\r
100 # Handle the QUIETLY and REQUIRED arguments and set MAXSDK_FOUND to TRUE if
\r
101 # all listed variables are TRUE.
\r
102 include(FindPackageHandleStandardArgs)
\r
103 find_package_handle_standard_args(MAXSDK DEFAULT_MSG
\r
104 MAXSDK_INCLUDE_DIR MAXSDK_CORE_LIBRARY)
\r
107 SET(MAXSDK_LIBRARIES
\r
108 ${MAXSDK_CORE_LIBRARY}
\r
109 ${MAXSDK_GEOM_LIBRARY}
\r
110 ${MAXSDK_GFX_LIBRARY}
\r
111 ${MAXSDK_MESH_LIBRARY}
\r
112 ${MAXSDK_MAXUTIL_LIBRARY}
\r
113 ${MAXSDK_MAXSCRIPT_LIBRARY}
\r
114 ${MAXSDK_PARAMBLK2_LIBRARY}
\r
115 ${MAXSDK_BMM_LIBRARY})
\r
117 # parse maxversion.h to determine SDK version
\r
118 IF(EXISTS "${MAXSDK_DIR}/include/maxversion.h")
\r
119 FILE(STRINGS "${MAXSDK_DIR}/include/maxversion.h" LINES REGEX "#define MAX_PRODUCT_YEAR_NUMBER ([0-9]+)")
\r
121 STRING(REGEX REPLACE ".+MAX_PRODUCT_YEAR_NUMBER ([0-9]+)" "\\1" MAXSDK_VERSION "${LINES}")
\r
124 SET(MAXSDK_VERSION "Unknown")
\r
127 MESSAGE(STATUS "Found 3dsmax version ${MAXSDK_VERSION} in ${MAXSDK_DIR}")
\r
129 # 3ds Max 2013 and later are always Unicode
\r
130 IF(MAXSDK_VERSION VERSION_GREATER 2012)
\r
131 SET(MAXSDK_DEFINITIONS -DUNICODE -D_UNICODE)
\r
133 SET(MAXSDK_DEFINITIONS)
\r
136 set(MAXSDK_LIBRARIES)
\r
139 mark_as_advanced(MAXSDK_INCLUDE_DIR MAXSDK_LIBRARY)
\r