25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

76 lines
2.9 KiB

  1. # - Find Assimp Installation
  2. #
  3. # Users can set the following variables before calling the module:
  4. # ASSIMP_DIR - The preferred installation prefix for searching for ASSIMP. Set by the user.
  5. #
  6. # ASSIMP_ROOT_DIR - the root directory where the installation can be found
  7. # ASSIMP_CXX_FLAGS - extra flags for compilation
  8. # ASSIMP_LINK_FLAGS - extra flags for linking
  9. # ASSIMP_INCLUDE_DIRS - include directories
  10. # ASSIMP_LIBRARY_DIRS - link directories
  11. # ASSIMP_LIBRARIES - libraries to link plugins with
  12. # ASSIMP_Boost_VERSION - the boost version assimp was compiled with
  13. get_filename_component(_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
  14. get_filename_component(_PREFIX "${_PREFIX}" PATH)
  15. get_filename_component(_PREFIX "${_PREFIX}" PATH)
  16. get_filename_component(ASSIMP_ROOT_DIR "${_PREFIX}" PATH)
  17. if( MSVC )
  18. # in order to prevent DLL hell, each of the DLLs have to be suffixed with the major version and msvc prefix
  19. if( MSVC70 OR MSVC71 )
  20. set(MSVC_PREFIX "vc70")
  21. elseif( MSVC80 )
  22. set(MSVC_PREFIX "vc80")
  23. elseif( MSVC90 )
  24. set(MSVC_PREFIX "vc90")
  25. else()
  26. set(MSVC_PREFIX "vc100")
  27. endif()
  28. set(ASSIMP_LIBRARY_SUFFIX "@ASSIMP_LIBRARY_SUFFIX@-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library" FORCE)
  29. else()
  30. set(ASSIMP_LIBRARY_SUFFIX "@ASSIMP_LIBRARY_SUFFIX@" CACHE STRING "the suffix for the openrave libraries" FORCE)
  31. endif()
  32. set( ASSIMP_CXX_FLAGS ) # dynamically linked library
  33. if( WIN32 )
  34. # for visual studio linking, most of the time boost dlls will be used
  35. set( ASSIMP_CXX_FLAGS " -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB")
  36. endif()
  37. set( ASSIMP_LINK_FLAGS "" )
  38. set( ASSIMP_LIBRARY_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_LIB_INSTALL_DIR@")
  39. set( ASSIMP_INCLUDE_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_INCLUDE_INSTALL_DIR@")
  40. set( ASSIMP_LIBRARIES assimp${ASSIMP_LIBRARY_SUFFIX})
  41. if (CMAKE_BUILD_TYPE EQUAL "DEBUG")
  42. set( ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES}D)
  43. endif (CMAKE_BUILD_TYPE EQUAL "DEBUG")
  44. # search for the boost version assimp was compiled with
  45. #set(Boost_USE_MULTITHREAD ON)
  46. #set(Boost_USE_STATIC_LIBS OFF)
  47. #set(Boost_USE_STATIC_RUNTIME OFF)
  48. #find_package(Boost ${ASSIMP_Boost_VERSION} EXACT COMPONENTS thread date_time)
  49. #if(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
  50. # set( ASSIMP_INCLUDE_DIRS "${ASSIMP_INCLUDE_DIRS}" ${Boost_INCLUDE_DIRS})
  51. #else(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
  52. # message(WARNING "Failed to find Boost ${ASSIMP_Boost_VERSION} necessary for assimp")
  53. #endif(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
  54. # the boost version assimp was compiled with
  55. set( ASSIMP_Boost_VERSION "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@")
  56. # for compatibility wiht pkg-config
  57. set(ASSIMP_CFLAGS_OTHER "${ASSIMP_CXX_FLAGS}")
  58. set(ASSIMP_LDFLAGS_OTHER "${ASSIMP_LINK_FLAGS}")
  59. MARK_AS_ADVANCED(
  60. ASSIMP_ROOT_DIR
  61. ASSIMP_CXX_FLAGS
  62. ASSIMP_LINK_FLAGS
  63. ASSIMP_INCLUDE_DIRS
  64. ASSIMP_LIBRARIES
  65. ASSIMP_Boost_VERSION
  66. ASSIMP_CFLAGS_OTHER
  67. ASSIMP_LDFLAGS_OTHER
  68. ASSIMP_LIBRARY_SUFFIX
  69. )