Changed: 3dsmax 2013 and up are always using Unicode

--HG--
branch : develop
This commit is contained in:
kervala 2016-11-15 10:55:41 +01:00
parent 2cbb1614d4
commit b36ded52df
10 changed files with 40 additions and 5 deletions

View file

@ -18,6 +18,7 @@ FIND_PATH(MAXSDK_DIR
PATHS
"$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk"
"$ENV{3DSMAX_2011_SDK_PATH}/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2017 SDK/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"
@ -36,12 +37,12 @@ FIND_PATH(MAXSDK_CS_INCLUDE_DIR bipexp.h
)
IF(TARGET_X64)
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib)
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib ${MAXSDK_DIR}/lib/x64/Release)
ELSE()
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/lib)
ENDIF()
MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY(${MYLIBRARY}
NAMES ${MYLIBRARYNAME}
HINTS
@ -73,8 +74,26 @@ if(MAXSDK_FOUND)
${MAXSDK_MAXUTIL_LIBRARY}
${MAXSDK_MAXSCRIPT_LIBRARY}
${MAXSDK_PARAMBLK2_LIBRARY}
${MAXSDK_BMM_LIBRARY} )
${MAXSDK_BMM_LIBRARY})
# 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()
ELSE()
set(MAXSDK_LIBRARIES)
ENDIF()

View file

@ -19,7 +19,9 @@ SET_TARGET_PROPERTIES(ligoscape_utility PROPERTIES SUFFIX ".dlx")
NL_DEFAULT_PROPS(ligoscape_utility "MAX Plugin: Ligoscape Utility")
NL_ADD_RUNTIME_FLAGS(ligoscape_utility)
NL_ADD_LIB_SUFFIX(ligoscape_utility)
ADD_DEFINITIONS(${MAXSDK_DEFINITIONS})
INSTALL(TARGETS ligoscape_utility RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)
INSTALL(FILES ligoscript.txt DESTINATION maxplugin/docs)
INSTALL(DIRECTORY scripts/

View file

@ -16,7 +16,7 @@ NL_ADD_RUNTIME_FLAGS(nel_3dsmax_shared)
NL_ADD_LIB_SUFFIX(nel_3dsmax_shared)
#SET_TARGET_PROPERTIES(nel_export PROPERTIES SUFFIX ".dlx")
ADD_DEFINITIONS(-DNEL_3DSMAX_SHARED_EXPORTS)
ADD_DEFINITIONS(-DNEL_3DSMAX_SHARED_EXPORTS ${MAXSDK_DEFINITIONS})
IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(nel_3dsmax_shared ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp)

View file

@ -25,6 +25,8 @@ NL_ADD_RUNTIME_FLAGS(nel_export)
NL_ADD_LIB_SUFFIX(nel_export)
SET_TARGET_PROPERTIES(nel_export PROPERTIES SUFFIX ".dlu")
ADD_DEFINITIONS(${MAXSDK_DEFINITIONS})
IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(nel_export ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.h ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.cpp)
ENDIF()

View file

@ -8,6 +8,8 @@ NL_DEFAULT_PROPS(nel_mesh_lib "MAX Plugin: NeL Mesh Library")
NL_ADD_RUNTIME_FLAGS(nel_mesh_lib)
NL_ADD_LIB_SUFFIX(nel_mesh_lib)
ADD_DEFINITIONS(${MAXSDK_DEFINITIONS})
IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(nel_mesh_lib ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.h ${CMAKE_CURRENT_SOURCE_DIR}/StdAfx.cpp)
ENDIF()

View file

@ -18,4 +18,6 @@ NL_DEFAULT_PROPS(nel_patch_converter "MAX Plugin: NeL Patch Converter")
NL_ADD_RUNTIME_FLAGS(nel_patch_converter)
NL_ADD_LIB_SUFFIX(nel_patch_converter)
ADD_DEFINITIONS(${MAXSDK_DEFINITIONS})
INSTALL(TARGETS nel_patch_converter RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)

View file

@ -18,6 +18,8 @@ NL_DEFAULT_PROPS(nel_patch_edit "MAX Plugin: NeL Patch Editor")
NL_ADD_RUNTIME_FLAGS(nel_patch_edit)
NL_ADD_LIB_SUFFIX(nel_patch_edit)
ADD_DEFINITIONS(${MAXSDK_DEFINITIONS})
IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(nel_patch_edit ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.h ${CMAKE_CURRENT_SOURCE_DIR}/stdafx.cpp)
ENDIF()

View file

@ -8,4 +8,6 @@ NL_DEFAULT_PROPS(nel_patch_lib "MAX Plugin: NeL Patch Library")
NL_ADD_RUNTIME_FLAGS(nel_patch_lib)
NL_ADD_LIB_SUFFIX(nel_patch_lib)
ADD_DEFINITIONS(${MAXSDK_DEFINITIONS})
INSTALL(TARGETS nel_patch_lib RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)

View file

@ -22,5 +22,7 @@ NL_DEFAULT_PROPS(nel_patch_paint "MAX Plugin: NeL Patch Painter")
NL_ADD_RUNTIME_FLAGS(nel_patch_paint)
NL_ADD_LIB_SUFFIX(nel_patch_paint)
ADD_DEFINITIONS(${MAXSDK_DEFINITIONS})
INSTALL(TARGETS nel_patch_paint RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)
INSTALL(FILES keys.cfg DESTINATION maxplugin/plugins )

View file

@ -19,4 +19,6 @@ NL_DEFAULT_PROPS(nel_vertex_tree_paint "MAX Plugin: NeL Vertex Tree Painter")
NL_ADD_RUNTIME_FLAGS(nel_vertex_tree_paint)
NL_ADD_LIB_SUFFIX(nel_vertex_tree_paint)
ADD_DEFINITIONS(${MAXSDK_DEFINITIONS})
INSTALL(TARGETS nel_vertex_tree_paint RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)