Skip to content
Permalink
Browse files

FBX plugin updates / PREFIX-NOTFOUND work-around

  • Loading branch information
DeadParrot authored and robertosfield committed Jan 26, 2020
1 parent ad11fd0 commit 8643c0001fb54ec7a852eae26a58abc7e69b5ece
Showing with 62 additions and 6 deletions.
  1. +51 −5 CMakeModules/FindFBX.cmake
  2. +3 −0 CMakeModules/ModuleInstall.cmake
  3. +8 −1 src/osgPlugins/fbx/CMakeLists.txt
@@ -25,17 +25,22 @@ ELSEIF(MSVC10)
SET(FBX_LIBDIR "vs2010")
ELSEIF(MSVC11)
SET(FBX_LIBDIR "vs2012")
ELSEIF(MSVC12 OR MSVC_VERSION==1800)
ELSEIF(MSVC_VERSION EQUAL 1800)
SET(FBX_LIBDIR "vs2013")
ELSEIF(MSVC14 OR MSVC_VERSION>1900)
ELSEIF(MSVC_VERSION EQUAL 1900)
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()

IF(APPLE)
# do nothing
ELSEIF(CMAKE_CL_64)
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)
ELSE()
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
@@ -53,26 +58,52 @@ ELSE()
SET(FBX_LIBNAME "libfbxsdk")
ELSE()
SET(FBX_LIBNAME "libfbxsdk-md")
IF(WIN32)
SET(FBX_XML2_LIBNAME "libxml2-md")
SET(FBX_ZLIB_LIBNAME "zlib-md")
ENDIF()
ENDIF()
ENDIF()

SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)

SET( FBX_SEARCH_PATHS
$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{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{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{PROGRAMFILES}/Autodesk/FBX/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{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{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{PROGRAMFILES}/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}
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)
SET(FBX_FOUND "YES")
ELSE()
@@ -67,6 +67,9 @@ ENDIF()

IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
IF("${PREFIX}" STREQUAL PREFIX-NOTFOUND) # Fix for PREFIX-NOTFOUND left in file names
SET(PREFIX "")
ENDIF()
IF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELEASE_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Release)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
@@ -37,6 +37,9 @@ IF(WIN32)
OPTION(FBX_SHARED OFF)
IF(FBX_SHARED)
ADD_DEFINITIONS(-DFBXSDK_SHARED)
ELSE()
SET(TARGET_EXTERNAL_LIBRARIES ${FBX_XML2_LIBRARY})
SET(TARGET_EXTERNAL_LIBRARIES ${FBX_ZLIB_LIBNAME})
ENDIF(FBX_SHARED)

SET(TARGET_EXTERNAL_LIBRARIES wininet)
@@ -49,7 +52,11 @@ IF(APPLE)
ENDIF(APPLE)

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 ###
SETUP_PLUGIN(fbx)

0 comments on commit 8643c00

Please sign in to comment.
You can’t perform that action at this time.