Improved Findassimp.cmake to support VS2015.
parent
c6d1fcca74
commit
1fd66df37d
|
@ -1,25 +1,75 @@
|
||||||
FIND_PATH(
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
assimp_INCLUDE_DIRS
|
set(ASSIMP_ARCHITECTURE "64")
|
||||||
NAMES postprocess.h scene.h version.h config.h cimport.h
|
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||||
PATHS /usr/local/include/
|
set(ASSIMP_ARCHITECTURE "32")
|
||||||
)
|
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
|
||||||
FIND_LIBRARY(
|
if(WIN32)
|
||||||
assimp_LIBRARIES
|
set(ASSIMP_ROOT_DIR CACHE PATH "ASSIMP root directory")
|
||||||
NAMES assimp
|
|
||||||
PATHS /usr/local/lib/
|
|
||||||
)
|
|
||||||
|
|
||||||
IF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
|
# Find path of each library
|
||||||
SET(assimp_FOUND TRUE)
|
find_path(ASSIMP_INCLUDE_DIR
|
||||||
ENDIF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
|
NAMES
|
||||||
|
assimp/anim.h
|
||||||
|
HINTS
|
||||||
|
${ASSIMP_ROOT_DIR}/include
|
||||||
|
)
|
||||||
|
|
||||||
IF (assimp_FOUND)
|
if(MSVC14)
|
||||||
IF (NOT assimp_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Found asset importer library: ${assimp_LIBRARIES}")
|
find_path(ASSIMP_LIBRARY_DIR
|
||||||
ENDIF (NOT assimp_FIND_QUIETLY)
|
NAMES
|
||||||
ELSE (assimp_FOUND)
|
assimp-vc140-mt.lib
|
||||||
IF (assimp_FIND_REQUIRED)
|
HINTS
|
||||||
MESSAGE(FATAL_ERROR "Could not find asset importer library")
|
${ASSIMP_ROOT_DIR}/lib${ASSIMP_ARCHITECTURE}
|
||||||
ENDIF (assimp_FIND_REQUIRED)
|
)
|
||||||
ENDIF (assimp_FOUND)
|
|
||||||
|
find_library(ASSIMP_LIBRARY_RELEASE assimp-vc140-mt.lib PATHS ${ASSIMP_LIBRARY_DIR})
|
||||||
|
find_library(ASSIMP_LIBRARY_DEBUG assimp-vc140-mtd.lib PATHS ${ASSIMP_LIBRARY_DIR})
|
||||||
|
|
||||||
|
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
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_ROOT_DIR}/bin${ASSIMP_ARCHITECTURE}/assimp-vc140-mtd.dll ${TargetDirectory}/Debug/assimp-vc140-mtd.dll
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_ROOT_DIR}/bin${ASSIMP_ARCHITECTURE}/assimp-vc140-mt.dll ${TargetDirectory}/Release/assimp-vc140-mt.dll
|
||||||
|
COMMENT "Copying Assimp binaries to '${TargetDirectory}'"
|
||||||
|
VERBATIM)
|
||||||
|
ENDFUNCTION(ASSIMP_COPY_BINARIES)
|
||||||
|
|
||||||
|
endif(MSVC14)
|
||||||
|
|
||||||
|
else(WIN32)
|
||||||
|
|
||||||
|
find_path(
|
||||||
|
assimp_INCLUDE_DIRS
|
||||||
|
NAMES postprocess.h scene.h version.h config.h cimport.h
|
||||||
|
PATHS /usr/local/include/
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(
|
||||||
|
assimp_LIBRARIES
|
||||||
|
NAMES assimp
|
||||||
|
PATHS /usr/local/lib/
|
||||||
|
)
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
endif(WIN32)
|
Loading…
Reference in New Issue