2009-11-19 19:44:44 +08:00
|
|
|
# Locate FBX
|
|
|
|
# This module defines:
|
|
|
|
# FBX_INCLUDE_DIR, where to find the headers
|
|
|
|
#
|
|
|
|
# FBX_LIBRARY, FBX_LIBRARY_DEBUG
|
|
|
|
# FBX_FOUND
|
|
|
|
#
|
|
|
|
# $FBX_DIR is an environment variable that would
|
|
|
|
# correspond to the ./configure --prefix=$FBX_DIR
|
|
|
|
|
|
|
|
IF(APPLE)
|
2017-02-24 22:54:07 +08:00
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
# using regular Clang or AppleClang
|
|
|
|
SET(FBX_LIBDIR "clang")
|
|
|
|
else()
|
2011-05-03 17:58:31 +08:00
|
|
|
SET(FBX_LIBDIR "gcc4/ub")
|
2017-02-24 22:54:07 +08:00
|
|
|
endif()
|
2009-11-19 19:44:44 +08:00
|
|
|
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
2011-05-03 17:58:31 +08:00
|
|
|
SET(FBX_LIBDIR "gcc4")
|
2009-11-19 19:44:44 +08:00
|
|
|
ELSEIF(MSVC80)
|
2011-05-03 17:58:31 +08:00
|
|
|
SET(FBX_LIBDIR "vs2005")
|
2010-07-10 17:56:06 +08:00
|
|
|
ELSEIF(MSVC90)
|
2011-05-03 17:58:31 +08:00
|
|
|
SET(FBX_LIBDIR "vs2008")
|
2013-06-03 22:27:14 +08:00
|
|
|
ELSEIF(MSVC10)
|
2011-05-03 17:58:31 +08:00
|
|
|
SET(FBX_LIBDIR "vs2010")
|
2014-04-10 01:40:27 +08:00
|
|
|
ELSEIF(MSVC11)
|
2013-06-03 22:27:14 +08:00
|
|
|
SET(FBX_LIBDIR "vs2012")
|
2016-06-07 00:54:29 +08:00
|
|
|
ELSEIF(MSVC12 OR MSVC_VERSION==1800)
|
2014-04-10 01:40:27 +08:00
|
|
|
SET(FBX_LIBDIR "vs2013")
|
2016-06-07 00:54:29 +08:00
|
|
|
ELSEIF(MSVC14 OR MSVC_VERSION>1900)
|
|
|
|
SET(FBX_LIBDIR "vs2015")
|
2010-06-15 17:14:20 +08:00
|
|
|
ENDIF()
|
2009-11-19 19:44:44 +08:00
|
|
|
|
2011-05-03 17:58:31 +08:00
|
|
|
IF(APPLE)
|
|
|
|
# do nothing
|
2011-05-04 17:48:10 +08:00
|
|
|
ELSEIF(CMAKE_CL_64)
|
|
|
|
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
|
|
|
|
ELSEIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
2011-05-03 17:58:31 +08:00
|
|
|
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
|
|
|
|
ELSE()
|
|
|
|
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
|
2010-06-15 17:14:20 +08:00
|
|
|
ENDIF()
|
2009-11-19 19:44:44 +08:00
|
|
|
|
2015-03-12 23:12:29 +08:00
|
|
|
#try to use 2015.1 or 2014.2 version
|
|
|
|
|
2009-11-19 19:44:44 +08:00
|
|
|
IF(APPLE)
|
2013-06-03 22:27:14 +08:00
|
|
|
SET(FBX_LIBNAME "libfbxsdk")
|
2011-05-03 17:58:31 +08:00
|
|
|
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
2013-07-01 17:12:11 +08:00
|
|
|
SET(FBX_LIBNAME "fbxsdk")
|
2010-06-15 17:14:20 +08:00
|
|
|
ELSE()
|
2016-12-21 23:13:49 +08:00
|
|
|
OPTION(FBX_SHARED OFF)
|
|
|
|
IF(FBX_SHARED)
|
|
|
|
SET(FBX_LIBNAME "libfbxsdk")
|
|
|
|
ELSE()
|
|
|
|
SET(FBX_LIBNAME "libfbxsdk-md")
|
|
|
|
ENDIF()
|
2010-06-15 17:14:20 +08:00
|
|
|
ENDIF()
|
|
|
|
|
2011-05-03 17:58:31 +08:00
|
|
|
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
|
|
|
|
|
|
|
SET( FBX_SEARCH_PATHS
|
2010-06-15 17:14:20 +08:00
|
|
|
$ENV{FBX_DIR}
|
2017-10-30 22:36:41 +08:00
|
|
|
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1"
|
|
|
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.1.1"
|
2017-02-24 22:54:07 +08:00
|
|
|
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.1"
|
|
|
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1"
|
|
|
|
"/Applications/Autodesk/FBX SDK/2017.1"
|
2017-10-30 22:36:41 +08:00
|
|
|
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.2"
|
|
|
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.2"
|
2016-06-07 00:54:29 +08:00
|
|
|
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.1"
|
|
|
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.1"
|
2015-03-12 23:12:29 +08:00
|
|
|
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1"
|
|
|
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
|
2016-06-01 18:25:31 +08:00
|
|
|
"/Applications/Autodesk/FBX/FBX SDK/2015.1"
|
2015-03-12 23:12:29 +08:00
|
|
|
/Applications/Autodesk/FBXSDK20151
|
2014-04-10 01:40:27 +08:00
|
|
|
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.2"
|
|
|
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.2"
|
2016-06-01 18:25:31 +08:00
|
|
|
"/Applications/Autodesk/FBX/FBX SDK/2014.2"
|
2015-03-12 23:12:29 +08:00
|
|
|
/Applications/Autodesk/FBXSDK20142
|
2009-11-19 19:44:44 +08:00
|
|
|
)
|
|
|
|
|
2010-06-15 17:14:20 +08:00
|
|
|
# search for headers & debug/release libraries
|
2011-05-03 17:58:31 +08:00
|
|
|
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
|
2010-06-15 17:14:20 +08:00
|
|
|
PATHS ${FBX_SEARCH_PATHS}
|
2011-05-03 17:58:31 +08:00
|
|
|
PATH_SUFFIXES "include")
|
2010-06-15 17:14:20 +08:00
|
|
|
FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
|
|
|
|
PATHS ${FBX_SEARCH_PATHS}
|
2013-06-03 22:27:14 +08:00
|
|
|
PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}")
|
|
|
|
|
2013-07-01 17:12:11 +08:00
|
|
|
#Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.
|
2013-06-03 22:27:14 +08:00
|
|
|
|
|
|
|
#no debug d suffix, search in debug folder only
|
|
|
|
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME}
|
|
|
|
PATHS ${FBX_SEARCH_PATHS}
|
|
|
|
PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug")
|
2010-06-15 17:14:20 +08:00
|
|
|
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
|
|
|
|
PATHS ${FBX_SEARCH_PATHS}
|
2011-05-03 17:58:31 +08:00
|
|
|
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
2013-07-01 17:12:11 +08:00
|
|
|
|
2009-11-19 19:44:44 +08:00
|
|
|
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
|
|
|
SET(FBX_FOUND "YES")
|
2010-06-15 17:14:20 +08:00
|
|
|
ELSE()
|
2009-11-19 19:44:44 +08:00
|
|
|
SET(FBX_FOUND "NO")
|
2010-06-15 17:14:20 +08:00
|
|
|
ENDIF()
|
2013-06-03 22:27:14 +08:00
|
|
|
|
2014-04-10 01:40:27 +08:00
|
|
|
IF(NOT FBX_FOUND)
|
|
|
|
#try to use 2014.1 version
|
|
|
|
IF(APPLE)
|
|
|
|
SET(FBX_LIBNAME "fbxsdk-2014.1")
|
|
|
|
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
SET(FBX_LIBNAME "fbxsdk-2014.1")
|
|
|
|
ELSE()
|
|
|
|
SET(FBX_LIBNAME "fbxsdk-2014.1")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
|
|
|
|
|
|
|
SET( FBX_SEARCH_PATHS
|
|
|
|
$ENV{FBX_DIR}
|
2016-06-01 18:25:31 +08:00
|
|
|
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1"
|
|
|
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1"
|
|
|
|
"/Applications/Autodesk/FBX/FBX SDK/2014.1"
|
2014-04-10 01:40:27 +08:00
|
|
|
/Applications/Autodesk/FBXSDK20141
|
|
|
|
)
|
|
|
|
|
|
|
|
# search for headers & debug/release libraries
|
|
|
|
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
|
|
|
|
PATHS ${FBX_SEARCH_PATHS}
|
|
|
|
PATH_SUFFIXES "include")
|
|
|
|
FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
|
|
|
|
PATHS ${FBX_SEARCH_PATHS}
|
|
|
|
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
|
|
|
|
|
|
|
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
|
|
|
|
PATHS ${FBX_SEARCH_PATHS}
|
|
|
|
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
|
|
|
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
|
|
|
SET(FBX_FOUND "YES")
|
|
|
|
ELSE()
|
|
|
|
SET(FBX_FOUND "NO")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
ENDIF()
|
|
|
|
|
2013-06-03 22:27:14 +08:00
|
|
|
IF(NOT FBX_FOUND)
|
|
|
|
#try to use 2013.3 version
|
|
|
|
IF(APPLE)
|
|
|
|
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
|
|
|
|
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
|
|
|
|
ELSE()
|
|
|
|
SET(FBX_LIBNAME "fbxsdk-2013.3-md")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
|
|
|
|
|
|
|
SET( FBX_SEARCH_PATHS
|
|
|
|
$ENV{FBX_DIR}
|
2016-06-01 19:49:55 +08:00
|
|
|
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2013.3"
|
|
|
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2013.3"
|
2016-06-01 18:25:31 +08:00
|
|
|
"/Applications/Autodesk/FBX/FBX SDK/2013.3"
|
2014-04-10 01:40:27 +08:00
|
|
|
/Applications/Autodesk/FBXSDK20133
|
2013-06-03 22:27:14 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# search for headers & debug/release libraries
|
|
|
|
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
|
|
|
|
PATHS ${FBX_SEARCH_PATHS}
|
|
|
|
PATH_SUFFIXES "include")
|
|
|
|
FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
|
|
|
|
PATHS ${FBX_SEARCH_PATHS}
|
|
|
|
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
|
|
|
|
|
|
|
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
|
|
|
|
PATHS ${FBX_SEARCH_PATHS}
|
|
|
|
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
|
|
|
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
|
|
|
SET(FBX_FOUND "YES")
|
|
|
|
ELSE()
|
|
|
|
SET(FBX_FOUND "NO")
|
|
|
|
ENDIF()
|
2013-07-01 17:12:11 +08:00
|
|
|
|
2013-06-03 22:27:14 +08:00
|
|
|
ENDIF()
|