Merge pull request #705 from Vertexwahn/master
Added custom target that copies generated libs and bin files to lib32/lib64 and bin32/64 folderpull/715/head
commit
078dd0c08b
|
@ -60,3 +60,15 @@ test/gtest/src/gtest-stamp/gtest-gitclone-lastrun.txt
|
||||||
Assimp.opensdf
|
Assimp.opensdf
|
||||||
contrib/zlib/CTestTestfile.cmake
|
contrib/zlib/CTestTestfile.cmake
|
||||||
ipch/assimp_viewer-44bbbcd1/assimp_viewerd-ccc45335.ipch
|
ipch/assimp_viewer-44bbbcd1/assimp_viewerd-ccc45335.ipch
|
||||||
|
bin64/assimp-vc140-mt.dll
|
||||||
|
bin64/assimp-vc140-mtd.dll
|
||||||
|
lib64/assimp-vc140-mt.exp
|
||||||
|
lib64/assimp-vc140-mtd.exp
|
||||||
|
lib64/assimp-vc140-mtd.ilk
|
||||||
|
lib64/assimp-vc140-mtd.pdb
|
||||||
|
bin64/assimp-vc120-mt.dll
|
||||||
|
bin64/assimp-vc120-mtd.dll
|
||||||
|
lib64/assimp-vc120-mtd.pdb
|
||||||
|
lib64/assimp-vc120-mtd.ilk
|
||||||
|
lib64/assimp-vc120-mtd.exp
|
||||||
|
lib64/assimp-vc120-mt.exp
|
||||||
|
|
|
@ -340,3 +340,31 @@ if(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES)
|
||||||
include(CPack)
|
include(CPack)
|
||||||
include(DebSourcePPA)
|
include(DebSourcePPA)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
set(BIN_DIR "${PROJECT_SOURCE_DIR}/bin64/")
|
||||||
|
set(LIB_DIR "${PROJECT_SOURCE_DIR}/lib64/")
|
||||||
|
elseif()
|
||||||
|
set(BIN_DIR "${PROJECT_SOURCE_DIR}/bin32/")
|
||||||
|
set(LIB_DIR "${PROJECT_SOURCE_DIR}/lib32/")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MSVC12)
|
||||||
|
set(ASSIMP_MSVC_VERSION "vc120")
|
||||||
|
elseif(MSVC14)
|
||||||
|
set(ASSIMP_MSVC_VERSION "vc140")
|
||||||
|
endif(MSVC12)
|
||||||
|
|
||||||
|
if(MSVC12 OR MSVC14)
|
||||||
|
add_custom_target(UpdateAssimpLibsDebugSymbolsAndDLLs COMMENT "Copying Assimp Libraries ..." VERBATIM)
|
||||||
|
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.dll ${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.dll VERBATIM)
|
||||||
|
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.exp ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.exp VERBATIM)
|
||||||
|
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.lib ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mt.lib VERBATIM)
|
||||||
|
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll ${BIN_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.dll VERBATIM)
|
||||||
|
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.exp ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.exp VERBATIM)
|
||||||
|
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.ilk VERBATIM)
|
||||||
|
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.lib ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.lib VERBATIM)
|
||||||
|
add_custom_command(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb VERBATIM)
|
||||||
|
endif(MSVC12 OR MSVC14)
|
||||||
|
endif (WIN32)
|
|
@ -1,25 +1,81 @@
|
||||||
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(MSVC12)
|
||||||
IF (NOT assimp_FIND_QUIETLY)
|
set(ASSIMP_MSVC_VERSION "vc120")
|
||||||
MESSAGE(STATUS "Found asset importer library: ${assimp_LIBRARIES}")
|
elseif(MSVC14)
|
||||||
ENDIF (NOT assimp_FIND_QUIETLY)
|
set(ASSIMP_MSVC_VERSION "vc140")
|
||||||
ELSE (assimp_FOUND)
|
endif(MSVC12)
|
||||||
IF (assimp_FIND_REQUIRED)
|
|
||||||
MESSAGE(FATAL_ERROR "Could not find asset importer library")
|
if(MSVC12 OR MSVC14)
|
||||||
ENDIF (assimp_FIND_REQUIRED)
|
|
||||||
ENDIF (assimp_FOUND)
|
find_path(ASSIMP_LIBRARY_DIR
|
||||||
|
NAMES
|
||||||
|
assimp-${ASSIMP_MSVC_VERSION}-mt.lib
|
||||||
|
HINTS
|
||||||
|
${ASSIMP_ROOT_DIR}/lib${ASSIMP_ARCHITECTURE}
|
||||||
|
)
|
||||||
|
|
||||||
|
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})
|
||||||
|
|
||||||
|
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-${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
|
||||||
|
COMMENT "Copying Assimp binaries to '${TargetDirectory}'"
|
||||||
|
VERBATIM)
|
||||||
|
ENDFUNCTION(ASSIMP_COPY_BINARIES)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
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