root/OpenSceneGraph/trunk/CMakeModules/FindFBX.cmake @ 12706

Revision 12706, 1.6 kB (checked in by robert, 3 years ago)

From Wang Rui, "This fixes a small problem in the FindFBX file. In CMake scripts,
VS2010 is not marked as MSVC100 but MSVC10. And CMake defines
MSVC_VERSION instead of MSVC_VER to indicate the version number. The
modification can find fbx sdk for VS2010 automatically now.
"

  • Property svn:eol-style set to native
Line 
1# Locate FBX
2# This module defines:
3# FBX_INCLUDE_DIR, where to find the headers
4#
5# FBX_LIBRARY, FBX_LIBRARY_DEBUG
6# FBX_FOUND
7#
8# $FBX_DIR is an environment variable that would
9# correspond to the ./configure --prefix=$FBX_DIR
10
11IF(APPLE)
12    SET(FBX_LIBDIR "gcc4/ub")
13ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
14    SET(FBX_LIBDIR "gcc4")
15ELSEIF(MSVC80)
16    SET(FBX_LIBDIR "vs2005")
17ELSEIF(MSVC90)
18    SET(FBX_LIBDIR "vs2008")
19ELSEIF(MSVC10 OR MSVC_VERSION>1600)
20    SET(FBX_LIBDIR "vs2010")
21ENDIF()
22
23IF(APPLE)
24    # do nothing
25ELSEIF(CMAKE_CL_64)
26    SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
27ELSEIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SIZEOF_VOID_P EQUAL 8)
28    SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
29ELSE()
30    SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
31ENDIF()
32
33IF(APPLE)
34    SET(FBX_LIBNAME "fbxsdk-2012.1-static")
35ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
36    SET(FBX_LIBNAME "fbxsdk-2012.1-static")
37ELSE()
38    SET(FBX_LIBNAME "fbxsdk-2012.1-md")
39ENDIF()
40
41SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
42
43SET( FBX_SEARCH_PATHS
44    $ENV{FBX_DIR}
45    $ENV{ProgramW6432}/Autodesk/FBX/FbxSdk/2012.1
46    $ENV{PROGRAMFILES}/Autodesk/FBX/FbxSdk/2012.1
47    /Applications/Autodesk/FBXSDK20121
48)
49
50# search for headers & debug/release libraries
51FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
52    PATHS ${FBX_SEARCH_PATHS}
53    PATH_SUFFIXES "include")
54FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
55    PATHS ${FBX_SEARCH_PATHS}
56    PATH_SUFFIXES "lib/${FBX_LIBDIR}")
57FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
58    PATHS ${FBX_SEARCH_PATHS}
59    PATH_SUFFIXES "lib/${FBX_LIBDIR}")
60
61IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
62    SET(FBX_FOUND "YES")
63ELSE()
64    SET(FBX_FOUND "NO")
65ENDIF()
Note: See TracBrowser for help on using the browser.