Skip to content

Commit

Permalink
Merge eafeaf8 into 1f00ec4
Browse files Browse the repository at this point in the history
  • Loading branch information
Squareys committed Jul 15, 2017
2 parents 1f00ec4 + eafeaf8 commit f667f53
Show file tree
Hide file tree
Showing 27 changed files with 2,308 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Expand Up @@ -50,10 +50,11 @@ find_package(Magnum REQUIRED)
include(CMakeDependentOption)

# Plugins to build
cmake_dependent_option(WITH_ANYIMAGEIMPORTER "Build AnyImageImporter plugin" OFF "NOT WITH_COLLADAIMPORTER;NOT WITH_OPENGEXIMPORTER" ON)
cmake_dependent_option(WITH_ANYIMAGEIMPORTER "Build AnyImageImporter plugin" OFF "NOT WITH_COLLADAIMPORTER;NOT WITH_OPENGEXIMPORTER;NOT WITH_ASSIMPIMPORTER" ON)
option(WITH_ANYAUDIOIMPORTER "Build AnyAudioImporter plugin" OFF)
option(WITH_ANYIMAGECONVERTER "Build AnyImageConverter plugin" OFF)
option(WITH_ANYSCENEIMPORTER "Build AnySceneImporter plugin" OFF)
option(WITH_ASSIMPIMPORTER "Build AssimpImporter plugin" OFF)
option(WITH_COLLADAIMPORTER "Build ColladaImporter plugin" OFF)
option(WITH_DDSIMPORTER "Build DdsImporter plugin" OFF)
option(WITH_DEVILIMAGEIMPORTER "Build DevILImageImporter plugin" OFF)
Expand Down
88 changes: 88 additions & 0 deletions modules/FindAssimp.cmake
@@ -0,0 +1,88 @@
#.rst:
# Find Assimp
# -------------
#
# Finds the Assimp library. This module defines:
#
# Assimp_FOUND - True if Assimp library is found
# Assimp::Assimp - Assimp imported target
#
# Additionally these variables are defined for internal usage:
#
# ASSIMP_LIBRARY - Assimp library
# ASSIMP_INCLUDE_DIR - Include dir
#

#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
# Vladimír Vondruš <mosra@centrum.cz>
# Copyright © 2017 Jonathan Hale <squareys@googlemail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#

find_path(ASSIMP_INCLUDE_DIR NAMES assimp/anim.h HINTS include)

if(WIN32)
if(MSVC12)
set(ASSIMP_MSVC_VERSION "vc120")
elseif(MSVC14)
set(ASSIMP_MSVC_VERSION "vc140")
else()
message(ERROR "Unsupported MSVC version.")
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ASSIMP_LIBRARY_DIR "lib64")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(ASSIMP_LIBRARY_DIR "lib32")
endif()

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})
else()
find_library(ASSIMP_LIBRARY_RELEASE assimp)
find_library(ASSIMP_LIBRARY_DEBUG assimpd)
endif()

include(SelectLibraryConfigurations)
select_library_configurations(ASSIMP)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Assimp DEFAULT_MSG
ASSIMP_LIBRARY
ASSIMP_INCLUDE_DIR)

if(NOT TARGET Assimp::Assimp)
add_library(Assimp::Assimp UNKNOWN IMPORTED)

if(ASSIMP_LIBRARY_DEBUG AND ASSIMP_LIBRARY_RELEASE)
set_target_properties(Assimp::Assimp PROPERTIES
IMPORTED_LOCATION_DEBUG ${ASSIMP_LIBRARY_DEBUG}
IMPORTED_LOCATION_RELEASE ${ASSIMP_LIBRARY_RELEASE})
else()
set_target_properties(Assimp::Assimp PROPERTIES
IMPORTED_LOCATION ${ASSIMP_LIBRARY})
endif()

set_target_properties(Assimp::Assimp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${ASSIMP_INCLUDE_DIR})
endif()
1 change: 1 addition & 0 deletions package/ci/travis-desktop.sh
Expand Up @@ -49,6 +49,7 @@ cmake .. \
-DWITH_ANYIMAGECONVERTER=ON \
-DWITH_ANYIMAGEIMPORTER=ON \
-DWITH_ANYSCENEIMPORTER=ON \
-DWITH_ASSIMPIMPORTER=ON \
-DWITH_COLLADAIMPORTER=$WITH_COLLADAIMPORTER \
-DWITH_DDSIMPORTER=ON \
-DWITH_DEVILIMAGEIMPORTER=ON \
Expand Down
6 changes: 4 additions & 2 deletions package/ci/travis.yml
Expand Up @@ -12,6 +12,7 @@ addons:
- libqt4-dev
- libdevil-dev
- libharfbuzz-dev
- libassimp-dev

matrix:
include:
Expand Down Expand Up @@ -49,6 +50,7 @@ matrix:
- libqt4-dev
- libdevil-dev
- libharfbuzz-dev
- libassimp-dev
- language: cpp
os: linux
dist: trusty
Expand Down Expand Up @@ -161,8 +163,8 @@ install:
# works. Replace with just `brew install emscripten` when sane again
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "emscripten" ]; then brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/53f53f6498ba0f507c443dd4f0c6217937f1ddf2/Formula/emscripten.rb && export LLVM=/usr/local/opt/emscripten/libexec/llvm/bin && emcc; fi

# HarfBuzz
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "desktop" ]; then brew install harfbuzz; fi
# HarfBuzz, Assimp
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$TARGET" == "desktop" ]; then brew install harfbuzz assimp; fi

script:
- if [ "$TRAVIS_OS_NAME" == "linux" ] && ( [ "$TARGET" == "desktop" ] || [ "$TARGET" == "desktop-sanitizers" ] ); then ./package/ci/travis-desktop.sh; fi
Expand Down
1 change: 1 addition & 0 deletions src/MagnumPlugins/AssimpImporter/AssimpImporter.conf
@@ -0,0 +1 @@
depends=AnyImageImporter

0 comments on commit f667f53

Please sign in to comment.