You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
140 lines
4.8 KiB
CMake
140 lines
4.8 KiB
CMake
15 years ago
|
# - Find DirectInput
|
||
|
# Find the DirectSound includes and libraries
|
||
|
#
|
||
11 years ago
|
# MAXSDK_DIR - 3DSMAX SDK root directory
|
||
15 years ago
|
# MAXSDK_INCLUDE_DIR - where to find baseinterface.h
|
||
|
# MAXSDK_LIBRARIES - List of libraries when using 3DSMAX.
|
||
|
# MAXSDK_FOUND - True if MAX SDK found.
|
||
|
|
||
|
if(MAXSDK_INCLUDE_DIR)
|
||
11 years ago
|
# Already in cache, be silent
|
||
|
SET(MAXSDK_FIND_QUIETLY TRUE)
|
||
9 years ago
|
endif()
|
||
15 years ago
|
|
||
6 years ago
|
set(_pf_x86 "PROGRAMFILES(x86)")
|
||
|
|
||
11 years ago
|
FIND_PATH(MAXSDK_DIR
|
||
|
"include/maxversion.h"
|
||
|
HINTS
|
||
|
"$ENV{MAXSDK_DIR}"
|
||
15 years ago
|
PATHS
|
||
6 years ago
|
"$ENV{ADSK_3DSMAX_SDK_2021}/maxsdk"
|
||
|
"$ENV{ADSK_3DSMAX_SDK_2020}/maxsdk"
|
||
|
"$ENV{ADSK_3DSMAX_SDK_2019}/maxsdk"
|
||
|
"$ENV{ADSK_3DSMAX_SDK_2018}/maxsdk"
|
||
|
"$ENV{ADSK_3DSMAX_SDK_2017}/maxsdk"
|
||
|
"$ENV{ADSK_3DSMAX_SDK_2016}/maxsdk"
|
||
|
"$ENV{ADSK_3DSMAX_SDK_2015}/maxsdk"
|
||
|
"$ENV{ADSK_3DSMAX_SDK_2014}/maxsdk"
|
||
|
"$ENV{ADSK_3DSMAX_SDK_2013}/maxsdk"
|
||
11 years ago
|
"$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk"
|
||
|
"$ENV{3DSMAX_2011_SDK_PATH}/maxsdk"
|
||
6 years ago
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2021 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2020 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2019 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2018 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2017 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2016 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2015 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2014 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2013 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2012 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2011 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2010 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2009 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 2008 SDK/maxsdk"
|
||
|
"$ENV{${_pf_x86}}/Autodesk/3ds Max 9 SDK/maxsdk"
|
||
6 years ago
|
"$ENV{${_pf_x86}}/Autodesk/3dsMax8/maxsdk"
|
||
6 years ago
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2021 SDK/maxsdk"
|
||
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2020 SDK/maxsdk"
|
||
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2019 SDK/maxsdk"
|
||
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2018 SDK/maxsdk"
|
||
8 years ago
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2017 SDK/maxsdk"
|
||
6 years ago
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2016 SDK/maxsdk"
|
||
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2015 SDK/maxsdk"
|
||
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2014 SDK/maxsdk"
|
||
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2013 SDK/maxsdk"
|
||
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2012 SDK/maxsdk"
|
||
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2011 SDK/maxsdk"
|
||
11 years ago
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk"
|
||
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk"
|
||
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk"
|
||
|
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk"
|
||
6 years ago
|
"$ENV{PROGRAMFILES}/Autodesk/3dsMax8/maxsdk"
|
||
11 years ago
|
)
|
||
15 years ago
|
|
||
11 years ago
|
FIND_PATH(MAXSDK_INCLUDE_DIR
|
||
|
max.h
|
||
|
HINTS
|
||
|
${MAXSDK_DIR}/include
|
||
15 years ago
|
)
|
||
|
|
||
11 years ago
|
FIND_PATH(MAXSDK_CS_INCLUDE_DIR bipexp.h
|
||
|
HINTS
|
||
|
${MAXSDK_DIR}/include/CS
|
||
|
)
|
||
|
|
||
|
IF(TARGET_X64)
|
||
8 years ago
|
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib ${MAXSDK_DIR}/lib/x64/Release)
|
||
9 years ago
|
ELSE()
|
||
11 years ago
|
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/lib)
|
||
9 years ago
|
ENDIF()
|
||
11 years ago
|
|
||
8 years ago
|
MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||
15 years ago
|
FIND_LIBRARY(${MYLIBRARY}
|
||
11 years ago
|
NAMES ${MYLIBRARYNAME}
|
||
|
HINTS
|
||
|
${MAXSDK_LIBRARY_DIRS}
|
||
|
)
|
||
9 years ago
|
ENDMACRO()
|
||
15 years ago
|
|
||
|
FIND_3DS_LIBRARY(MAXSDK_CORE_LIBRARY core)
|
||
|
FIND_3DS_LIBRARY(MAXSDK_GEOM_LIBRARY geom)
|
||
|
FIND_3DS_LIBRARY(MAXSDK_GFX_LIBRARY gfx)
|
||
|
FIND_3DS_LIBRARY(MAXSDK_MESH_LIBRARY mesh)
|
||
|
FIND_3DS_LIBRARY(MAXSDK_MAXUTIL_LIBRARY maxutil)
|
||
|
FIND_3DS_LIBRARY(MAXSDK_MAXSCRIPT_LIBRARY maxscrpt)
|
||
|
FIND_3DS_LIBRARY(MAXSDK_PARAMBLK2_LIBRARY paramblk2)
|
||
|
FIND_3DS_LIBRARY(MAXSDK_BMM_LIBRARY bmm)
|
||
|
|
||
|
# Handle the QUIETLY and REQUIRED arguments and set MAXSDK_FOUND to TRUE if
|
||
|
# all listed variables are TRUE.
|
||
|
include(FindPackageHandleStandardArgs)
|
||
|
find_package_handle_standard_args(MAXSDK DEFAULT_MSG
|
||
|
MAXSDK_INCLUDE_DIR MAXSDK_CORE_LIBRARY)
|
||
|
|
||
|
if(MAXSDK_FOUND)
|
||
|
SET(MAXSDK_LIBRARIES
|
||
|
${MAXSDK_CORE_LIBRARY}
|
||
|
${MAXSDK_GEOM_LIBRARY}
|
||
|
${MAXSDK_GFX_LIBRARY}
|
||
|
${MAXSDK_MESH_LIBRARY}
|
||
|
${MAXSDK_MAXUTIL_LIBRARY}
|
||
|
${MAXSDK_MAXSCRIPT_LIBRARY}
|
||
|
${MAXSDK_PARAMBLK2_LIBRARY}
|
||
8 years ago
|
${MAXSDK_BMM_LIBRARY})
|
||
15 years ago
|
|
||
8 years ago
|
# parse maxversion.h to determine SDK version
|
||
|
IF(EXISTS "${MAXSDK_DIR}/include/maxversion.h")
|
||
|
FILE(STRINGS "${MAXSDK_DIR}/include/maxversion.h" LINES REGEX "#define MAX_PRODUCT_YEAR_NUMBER ([0-9]+)")
|
||
|
|
||
|
STRING(REGEX REPLACE ".+MAX_PRODUCT_YEAR_NUMBER ([0-9]+)" "\\1" MAXSDK_VERSION "${LINES}")
|
||
|
UNSET(LINES)
|
||
|
ELSE()
|
||
|
SET(MAXSDK_VERSION "Unknown")
|
||
|
ENDIF()
|
||
|
|
||
|
MESSAGE(STATUS "Found 3dsmax version ${MAXSDK_VERSION} in ${MAXSDK_DIR}")
|
||
|
|
||
|
# 3ds Max 2013 and later are always Unicode
|
||
|
IF(MAXSDK_VERSION VERSION_GREATER 2012)
|
||
|
SET(MAXSDK_DEFINITIONS -DUNICODE -D_UNICODE)
|
||
|
ELSE()
|
||
|
SET(MAXSDK_DEFINITIONS)
|
||
|
ENDIF()
|
||
8 years ago
|
ELSE()
|
||
15 years ago
|
set(MAXSDK_LIBRARIES)
|
||
8 years ago
|
ENDIF()
|
||
15 years ago
|
|
||
|
mark_as_advanced(MAXSDK_INCLUDE_DIR MAXSDK_LIBRARY)
|