Merge branch 'main/rendor-staging' into fixes
[ryzomcore.git] / CMakeModules / Findassimp.cmake
blobb4bf0da9941d99184dd923a377510be7a07cf342
1 IF(assimp_FIND_REQUIRED)
2   SET(ASSIMP_FIND_REQUIRED ON)
3 ENDIF()
5 FIND_PATH(
6         ASSIMP_INCLUDE_DIRS
7         NAMES assimp/postprocess.h assimp/scene.h assimp/version.h assimp/config.h assimp/cimport.h
8         PATHS /usr/local/include/
11 FIND_LIBRARY(
12         ASSIMP_LIBRARY_RELEASE
13         NAMES assimp
14         PATHS /usr/local/lib/
17 FIND_LIBRARY(
18         IRRXML_LIBRARY_RELEASE
19         NAMES IrrXML
20         PATHS /usr/local/lib/
23 FIND_LIBRARY(
24         ASSIMP_LIBRARY_DEBUG
25         NAMES assimpd
26         PATHS /usr/local/lib/
29 FIND_LIBRARY(
30         IRRXML_LIBRARY_DEBUG
31         NAMES IrrXMLd
32         PATHS /usr/local/lib/
35 IF (ASSIMP_INCLUDE_DIRS)
36     SET(ASSIMP_FOUND TRUE)
37     IF(ASSIMP_LIBRARY_RELEASE)
38       SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${ASSIMP_LIBRARY_RELEASE})
39     ENDIF()
40     IF(ASSIMP_LIBRARY_DEBUG)
41       SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${ASSIMP_LIBRARY_DEBUG})
42     ENDIF()
43     FIND_PACKAGE(ZLIB)
44     IF(ZLIB_FOUND)
45         SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} ${ZLIB_LIBRARIES})
46     ENDIF()
47     IF(IRRXML_LIBRARY_RELEASE)
48       SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${IRRXML_LIBRARY_RELEASE})
49     ENDIF()
50     IF(IRRXML_LIBRARY_DEBUG)
51       SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${IRRXML_LIBRARY_DEBUG})
52     ENDIF()
53 ENDIF()
55 IF (ASSIMP_FOUND)
56     IF (NOT ASSIMP_FIND_QUIETLY)
57         MESSAGE(STATUS "Found asset importer library: ${ASSIMP_LIBRARIES}")
58     ENDIF ()
59 ELSE (ASSIMP_FOUND)
60     IF (ASSIMP_FIND_REQUIRED)
61         MESSAGE(FATAL_ERROR "Could not find asset importer library")
62     ENDIF ()
63 ENDIF ()