FBX plugin updates / PREFIX-NOTFOUND work-around

This commit is contained in:
Stuart Mentzer 2020-01-26 14:28:56 -05:00
parent f3c615631b
commit 7a442801cd
3 changed files with 62 additions and 6 deletions

View File

@ -25,17 +25,22 @@ ELSEIF(MSVC10)
SET(FBX_LIBDIR "vs2010") SET(FBX_LIBDIR "vs2010")
ELSEIF(MSVC11) ELSEIF(MSVC11)
SET(FBX_LIBDIR "vs2012") SET(FBX_LIBDIR "vs2012")
ELSEIF(MSVC12 OR MSVC_VERSION==1800) ELSEIF(MSVC_VERSION EQUAL 1800)
SET(FBX_LIBDIR "vs2013") SET(FBX_LIBDIR "vs2013")
ELSEIF(MSVC14 OR MSVC_VERSION>1900) ELSEIF(MSVC_VERSION EQUAL 1900)
SET(FBX_LIBDIR "vs2015") SET(FBX_LIBDIR "vs2015")
ELSEIF(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920)
SET(FBX_LIBDIR "vs2017")
ELSEIF(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930)
# SET(FBX_LIBDIR "vs2019") # FBX doesn't have this yet as of version 2020.0.1
SET(FBX_LIBDIR "vs2017") # Binary compatible with vs2019
ENDIF() ENDIF()
IF(APPLE) IF(APPLE)
# do nothing # do nothing
ELSEIF(CMAKE_CL_64) ELSEIF(CMAKE_CL_64)
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64) SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
ELSEIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SIZEOF_VOID_P EQUAL 8) ELSEIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64) SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
ELSE() ELSE()
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86) SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
@ -53,6 +58,10 @@ ELSE()
SET(FBX_LIBNAME "libfbxsdk") SET(FBX_LIBNAME "libfbxsdk")
ELSE() ELSE()
SET(FBX_LIBNAME "libfbxsdk-md") SET(FBX_LIBNAME "libfbxsdk-md")
IF(WIN32)
SET(FBX_XML2_LIBNAME "libxml2-md")
SET(FBX_ZLIB_LIBNAME "zlib-md")
ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()
@ -60,19 +69,41 @@ SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
SET( FBX_SEARCH_PATHS SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR} $ENV{FBX_DIR}
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2020.0.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2020.0.1"
"/Applications/Autodesk/FBX SDK/2020.0.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2020.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2020.0"
"/Applications/Autodesk/FBX SDK/2020.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.5"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.5"
"/Applications/Autodesk/FBX SDK/2019.5"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.2"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.2"
"/Applications/Autodesk/FBX SDK/2019.2"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.0" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.0" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.0"
"/Applications/Autodesk/FBX\ SDK/2019.0" "/Applications/Autodesk/FBX SDK/2019.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.1.1" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.1.1"
"/Applications/Autodesk/FBX\ SDK/2018.0" "/Applications/Autodesk/FBX SDK/2018.1.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.0"
"/Applications/Autodesk/FBX SDK/2018.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.1" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1"
"/Applications/Autodesk/FBX SDK/2017.1" "/Applications/Autodesk/FBX SDK/2017.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.0"
"/Applications/Autodesk/FBX SDK/2017.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.2" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.2"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.2" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.2"
"/Applications/Autodesk/FBX/FBX SDK/2016.1.2"
/Applications/Autodesk/FBXSDK201612
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.1" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.1" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.1"
"/Applications/Autodesk/FBX/FBX SDK/2016.1.1"
/Applications/Autodesk/FBXSDK201611
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
"/Applications/Autodesk/FBX/FBX SDK/2015.1" "/Applications/Autodesk/FBX/FBX SDK/2015.1"
@ -101,6 +132,21 @@ FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
PATHS ${FBX_SEARCH_PATHS} PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}") PATH_SUFFIXES "lib/${FBX_LIBDIR}")
IF(WIN32)
FIND_LIBRARY( FBX_XML2_LIBRARY ${FBX_XML2_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}")
FIND_LIBRARY( FBX_ZLIB_LIBRARY ${FBX_ZLIB_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}")
FIND_LIBRARY( FBX_XML2_LIBRARY_DEBUG ${FBX_XML2_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug")
FIND_LIBRARY( FBX_ZLIB_LIBRARY_DEBUG ${FBX_ZLIB_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug")
ENDIF()
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR) IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
SET(FBX_FOUND "YES") SET(FBX_FOUND "YES")
ELSE() ELSE()

View File

@ -34,6 +34,9 @@ INSTALL(
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH) IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX) GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
IF("${PREFIX}" STREQUAL PREFIX-NOTFOUND) # Fix for PREFIX-NOTFOUND left in file names
SET(PREFIX "")
ENDIF()
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo) INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug) INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH) ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)

View File

@ -37,6 +37,9 @@ IF(WIN32)
OPTION(FBX_SHARED OFF) OPTION(FBX_SHARED OFF)
IF(FBX_SHARED) IF(FBX_SHARED)
ADD_DEFINITIONS(-DFBXSDK_SHARED) ADD_DEFINITIONS(-DFBXSDK_SHARED)
ELSE()
SET(TARGET_EXTERNAL_LIBRARIES ${FBX_XML2_LIBRARY})
SET(TARGET_EXTERNAL_LIBRARIES ${FBX_ZLIB_LIBNAME})
ENDIF(FBX_SHARED) ENDIF(FBX_SHARED)
SET(TARGET_EXTERNAL_LIBRARIES wininet) SET(TARGET_EXTERNAL_LIBRARIES wininet)
@ -49,7 +52,11 @@ IF(APPLE)
ENDIF(APPLE) ENDIF(APPLE)
SET(TARGET_LIBRARIES_VARS FBX_LIBRARY) SET(TARGET_LIBRARIES_VARS FBX_LIBRARY)
SET(TARGET_ADDED_LIBRARIES osgAnimation) IF (CMAKE_BUILD_TYPE MATCHES "debug" OR CMAKE_BUILD_TYPE MATCHES "DEBUG")
SET(TARGET_ADDED_LIBRARIES osgAnimation ${FBX_XML2_LIBRARY_DEBUG})
ELSE()
SET(TARGET_ADDED_LIBRARIES osgAnimation ${FBX_XML2_LIBRARY})
ENDIF()
#### end var setup ### #### end var setup ###
SETUP_PLUGIN(fbx) SETUP_PLUGIN(fbx)