2015-12-10 16:58:55 +00:00
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(ASSIMP_ARCHITECTURE "64")
|
|
|
|
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
|
|
set(ASSIMP_ARCHITECTURE "32")
|
|
|
|
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set(ASSIMP_ROOT_DIR CACHE PATH "ASSIMP root directory")
|
2014-05-11 11:56:38 +00:00
|
|
|
|
2015-12-10 16:58:55 +00:00
|
|
|
# Find path of each library
|
|
|
|
find_path(ASSIMP_INCLUDE_DIR
|
|
|
|
NAMES
|
|
|
|
assimp/anim.h
|
|
|
|
HINTS
|
|
|
|
${ASSIMP_ROOT_DIR}/include
|
|
|
|
)
|
2014-05-11 11:56:38 +00:00
|
|
|
|
2015-12-11 09:33:47 +00:00
|
|
|
if(MSVC12)
|
|
|
|
set(ASSIMP_MSVC_VERSION "vc120")
|
|
|
|
elseif(MSVC14)
|
|
|
|
set(ASSIMP_MSVC_VERSION "vc140")
|
|
|
|
endif(MSVC12)
|
|
|
|
|
|
|
|
if(MSVC12 OR MSVC14)
|
2015-12-10 16:58:55 +00:00
|
|
|
|
|
|
|
find_path(ASSIMP_LIBRARY_DIR
|
|
|
|
NAMES
|
2015-12-11 09:33:47 +00:00
|
|
|
assimp-${ASSIMP_MSVC_VERSION}-mt.lib
|
2015-12-10 16:58:55 +00:00
|
|
|
HINTS
|
|
|
|
${ASSIMP_ROOT_DIR}/lib${ASSIMP_ARCHITECTURE}
|
|
|
|
)
|
|
|
|
|
2015-12-11 09:33:47 +00:00
|
|
|
find_library(ASSIMP_LIBRARY_RELEASE assimp-${ASSIMP_MSVC_VERSION}-mt.lib PATHS ${ASSIMP_LIBRARY_DIR})
|
|
|
|
find_library(ASSIMP_LIBRARY_DEBUG assimp-${ASSIMP_MSVC_VERSION}-mtd.lib PATHS ${ASSIMP_LIBRARY_DIR})
|
2015-12-10 16:58:55 +00:00
|
|
|
|
|
|
|
set(ASSIMP_LIBRARY
|
|
|
|
optimized ${ASSIMP_LIBRARY_RELEASE}
|
|
|
|
debug ${ASSIMP_LIBRARY_DEBUG}
|
|
|
|
)
|
|
|
|
|
|
|
|
set(ASSIMP_LIBRARIES "ASSIMP_LIBRARY_RELEASE" "ASSIMP_LIBRARY_DEBUG")
|
|
|
|
|
|
|
|
FUNCTION(ASSIMP_COPY_BINARIES TargetDirectory)
|
|
|
|
ADD_CUSTOM_TARGET(AssimpCopyBinaries
|
2015-12-11 09:33:47 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_ROOT_DIR}/bin${ASSIMP_ARCHITECTURE}/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll ${TargetDirectory}/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_ROOT_DIR}/bin${ASSIMP_ARCHITECTURE}/assimp-${ASSIMP_MSVC_VERSION}-mt.dll ${TargetDirectory}/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.dll
|
2015-12-10 16:58:55 +00:00
|
|
|
COMMENT "Copying Assimp binaries to '${TargetDirectory}'"
|
|
|
|
VERBATIM)
|
|
|
|
ENDFUNCTION(ASSIMP_COPY_BINARIES)
|
|
|
|
|
2015-12-11 09:33:47 +00:00
|
|
|
endif()
|
2015-12-10 16:58:55 +00:00
|
|
|
|
|
|
|
else(WIN32)
|
2014-05-11 11:56:38 +00:00
|
|
|
|
2015-12-10 16:58:55 +00:00
|
|
|
find_path(
|
|
|
|
assimp_INCLUDE_DIRS
|
2019-10-07 19:07:51 +00:00
|
|
|
NAMES assimp/postprocess.h assimp/scene.h assimp/version.h assimp/config.h assimp/cimport.h
|
|
|
|
PATHS /usr/local/include
|
|
|
|
PATHS /usr/include/
|
|
|
|
|
2015-12-10 16:58:55 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
find_library(
|
|
|
|
assimp_LIBRARIES
|
|
|
|
NAMES assimp
|
|
|
|
PATHS /usr/local/lib/
|
2019-10-07 18:41:38 +00:00
|
|
|
PATHS /usr/lib64/
|
|
|
|
PATHS /usr/lib/
|
2015-12-10 16:58:55 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
|
|
|
|
SET(assimp_FOUND TRUE)
|
|
|
|
ENDIF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
|
|
|
|
|
|
|
|
if (assimp_FOUND)
|
|
|
|
if (NOT assimp_FIND_QUIETLY)
|
|
|
|
message(STATUS "Found asset importer library: ${assimp_LIBRARIES}")
|
|
|
|
endif (NOT assimp_FIND_QUIETLY)
|
|
|
|
else (assimp_FOUND)
|
|
|
|
if (assimp_FIND_REQUIRED)
|
|
|
|
message(FATAL_ERROR "Could not find asset importer library")
|
|
|
|
endif (assimp_FIND_REQUIRED)
|
|
|
|
endif (assimp_FOUND)
|
|
|
|
|
2019-10-07 18:41:38 +00:00
|
|
|
endif(WIN32)
|