From c9aa7142bc1d44cdaaf1b85c98a88f3cdb0ebebc Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 3 Oct 2017 14:33:25 +0200 Subject: [PATCH] Fixed: New versions of AssImp depend on IrrXML --HG-- branch : develop --- code/CMakeModules/Findassimp.cmake | 62 ++++++++++++++++----- code/nel/tools/3d/mesh_utils/CMakeLists.txt | 4 +- 2 files changed, 50 insertions(+), 16 deletions(-) diff --git a/code/CMakeModules/Findassimp.cmake b/code/CMakeModules/Findassimp.cmake index 41e53cf94..b4bf0da99 100644 --- a/code/CMakeModules/Findassimp.cmake +++ b/code/CMakeModules/Findassimp.cmake @@ -1,29 +1,63 @@ +IF(assimp_FIND_REQUIRED) + SET(ASSIMP_FIND_REQUIRED ON) +ENDIF() + FIND_PATH( - assimp_INCLUDE_DIRS + ASSIMP_INCLUDE_DIRS NAMES assimp/postprocess.h assimp/scene.h assimp/version.h assimp/config.h assimp/cimport.h PATHS /usr/local/include/ ) FIND_LIBRARY( - assimp_LIBRARIES + ASSIMP_LIBRARY_RELEASE NAMES assimp PATHS /usr/local/lib/ ) -IF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES) - SET(assimp_FOUND TRUE) +FIND_LIBRARY( + IRRXML_LIBRARY_RELEASE + NAMES IrrXML + PATHS /usr/local/lib/ +) + +FIND_LIBRARY( + ASSIMP_LIBRARY_DEBUG + NAMES assimpd + PATHS /usr/local/lib/ +) + +FIND_LIBRARY( + IRRXML_LIBRARY_DEBUG + NAMES IrrXMLd + PATHS /usr/local/lib/ +) + +IF (ASSIMP_INCLUDE_DIRS) + SET(ASSIMP_FOUND TRUE) + IF(ASSIMP_LIBRARY_RELEASE) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${ASSIMP_LIBRARY_RELEASE}) + ENDIF() + IF(ASSIMP_LIBRARY_DEBUG) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${ASSIMP_LIBRARY_DEBUG}) + ENDIF() FIND_PACKAGE(ZLIB) IF(ZLIB_FOUND) - SET(assimp_LIBRARIES ${assimp_LIBRARIES} ${ZLIB_LIBRARIES}) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} ${ZLIB_LIBRARIES}) ENDIF() -ENDIF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES) + IF(IRRXML_LIBRARY_RELEASE) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${IRRXML_LIBRARY_RELEASE}) + ENDIF() + IF(IRRXML_LIBRARY_DEBUG) + SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${IRRXML_LIBRARY_DEBUG}) + ENDIF() +ENDIF() -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) +IF (ASSIMP_FOUND) + IF (NOT ASSIMP_FIND_QUIETLY) + MESSAGE(STATUS "Found asset importer library: ${ASSIMP_LIBRARIES}") + ENDIF () +ELSE (ASSIMP_FOUND) + IF (ASSIMP_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could not find asset importer library") - ENDIF (assimp_FIND_REQUIRED) -ENDIF (assimp_FOUND) + ENDIF () +ENDIF () diff --git a/code/nel/tools/3d/mesh_utils/CMakeLists.txt b/code/nel/tools/3d/mesh_utils/CMakeLists.txt index 0d9f6deb3..d8a5b29d9 100644 --- a/code/nel/tools/3d/mesh_utils/CMakeLists.txt +++ b/code/nel/tools/3d/mesh_utils/CMakeLists.txt @@ -3,11 +3,11 @@ FILE(GLOB HDRS *.h) SOURCE_GROUP("" FILES ${SRCS} ${HDRS}) -INCLUDE_DIRECTORIES(${assimp_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${ASSIMP_INCLUDE_DIRS}) NL_TARGET_LIB(mesh_utils ${SRCS} ${HDRS}) -TARGET_LINK_LIBRARIES(mesh_utils ${assimp_LIBRARIES} nelmisc nelpipeline nel3d) +TARGET_LINK_LIBRARIES(mesh_utils ${ASSIMP_LIBRARIES} nelmisc nelpipeline nel3d) NL_DEFAULT_PROPS(mesh_utils "NeL, Tools, 3D: Mesh Utils") NL_ADD_RUNTIME_FLAGS(mesh_utils)