khanat-opennel-code/code/CMakeModules/Find3dsMaxSDK.cmake

83 lines
2.2 KiB
CMake
Raw Permalink Normal View History

2010-05-06 00:08:41 +00:00
# - Find DirectInput
# Find the DirectSound includes and libraries
#
# MAXSDK_DIR - 3DSMAX SDK root directory
2010-05-06 00:08:41 +00:00
# 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)
# Already in cache, be silent
SET(MAXSDK_FIND_QUIETLY TRUE)
2015-12-15 12:41:27 +00:00
endif()
2010-05-06 00:08:41 +00:00
FIND_PATH(MAXSDK_DIR
"include/maxversion.h"
HINTS
"$ENV{MAXSDK_DIR}"
2010-05-06 00:08:41 +00:00
PATHS
"$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk"
"$ENV{3DSMAX_2011_SDK_PATH}/maxsdk"
"$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"
)
2010-05-06 00:08:41 +00:00
FIND_PATH(MAXSDK_INCLUDE_DIR
max.h
HINTS
${MAXSDK_DIR}/include
2010-05-06 00:08:41 +00:00
)
FIND_PATH(MAXSDK_CS_INCLUDE_DIR bipexp.h
HINTS
${MAXSDK_DIR}/include/CS
)
IF(TARGET_X64)
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib)
2015-12-15 12:41:27 +00:00
ELSE()
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/lib)
2015-12-15 12:41:27 +00:00
ENDIF()
2010-05-06 00:08:41 +00:00
MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY(${MYLIBRARY}
NAMES ${MYLIBRARYNAME}
HINTS
${MAXSDK_LIBRARY_DIRS}
)
2015-12-15 12:41:27 +00:00
ENDMACRO()
2010-05-06 00:08:41 +00:00
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}
${MAXSDK_BMM_LIBRARY} )
else(MAXSDK_FOUND)
set(MAXSDK_LIBRARIES)
endif(MAXSDK_FOUND)
mark_as_advanced(MAXSDK_INCLUDE_DIR MAXSDK_LIBRARY)