From 8179ee383611824d4f37c53ec1d253a1ed204e93 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 19 Sep 2015 16:46:59 +0200 Subject: [PATCH] Add assimp dependency --HG-- branch : feature-export-assimp --- code/CMakeLists.txt | 4 ++++ code/CMakeModules/Findassimp.cmake | 25 +++++++++++++++++++++++++ code/CMakeModules/nel.cmake | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 code/CMakeModules/Findassimp.cmake diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 440a5fcd3..32e5e6591 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -146,6 +146,10 @@ IF(WITH_QT) FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml QtOpenGL REQUIRED) ENDIF(WITH_QT) +IF(WITH_ASSIMP) + FIND_PACKAGE(assimp REQUIRED) +ENDIF(WITH_ASSIMP) + IF(WITH_NEL) IF(WITH_NEL_TESTS) FIND_PACKAGE(CppTest) diff --git a/code/CMakeModules/Findassimp.cmake b/code/CMakeModules/Findassimp.cmake new file mode 100644 index 000000000..6748cd221 --- /dev/null +++ b/code/CMakeModules/Findassimp.cmake @@ -0,0 +1,25 @@ +FIND_PATH( + 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 + 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) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 52ee640e9..28e36bd61 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -274,6 +274,8 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF) OPTION(WITH_INSTALL_LIBRARIES "Install development files." ON ) + OPTION(WITH_ASSIMP "Use assimp exporter" OFF) + ### # GUI toolkits ###