diff options
author | Josh Heidenreich <josh.sickmate@gmail.com> | 2014-01-28 22:36:27 (GMT) |
---|---|---|
committer | Tony Theodore <tonyt@logyst.com> | 2014-02-01 01:23:26 (GMT) |
commit | 5832d3b707c991d8243891f571837e0c48c75180 (patch) | |
tree | 845b8dfc95961066d832adfa35281d7b31fee002 | |
parent | 04862bc8d97ac85187eaf1248d9ee8c767050419 (diff) | |
download | mxe-5832d3b707c991d8243891f571837e0c48c75180.zip mxe-5832d3b707c991d8243891f571837e0c48c75180.tar.gz mxe-5832d3b707c991d8243891f571837e0c48c75180.tar.bz2 |
add package assimp
-rw-r--r-- | index.html | 4 | ||||
-rw-r--r-- | src/assimp-test.c | 31 | ||||
-rw-r--r-- | src/assimp.mk | 32 |
3 files changed, 67 insertions, 0 deletions
@@ -1116,6 +1116,10 @@ local-pkg-list: $(LOCAL_PKG_LIST)</pre> <td class="website"><a href="http://arma.sourceforge.net/">Armadillo C++ linear algebra library</a></td> </tr> <tr> + <td class="package">assimp</td> + <td class="website"><a href="http://assimp.sourceforge.net/">Assimp Open Asset Import Library</a></td> + </tr> + <tr> <td class="package">atk</td> <td class="website"><a href="http://www.gtk.org/">ATK</a></td> </tr> diff --git a/src/assimp-test.c b/src/assimp-test.c new file mode 100644 index 0000000..24866cf --- /dev/null +++ b/src/assimp-test.c @@ -0,0 +1,31 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include <assimp/cimport.h> +#include <assimp/scene.h> +#include <assimp/postprocess.h> +#include <string.h> + +int main(int argc, char *argv[]) +{ + const struct aiScene* scene = NULL; + + /* NFF file for a single spere with radius 5 at pos 0x0x0 */ + const char* buf = + "--- begin of file\n" + "s 0 0 0 5\n" + "--- end of file\n"; + + (void)argc; + (void)argv; + + scene = aiImportFileFromMemory(buf, strlen(buf), aiProcessPreset_TargetRealtime_MaxQuality, "nff"); + (void)scene; + + if (scene->mNumMeshes != 1) return 1; + + aiReleaseImport(scene); + return 0; +} diff --git a/src/assimp.mk b/src/assimp.mk new file mode 100644 index 0000000..7a94034 --- /dev/null +++ b/src/assimp.mk @@ -0,0 +1,32 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := assimp +$(PKG)_IGNORE := +$(PKG)_VERSION := 3.0 +$(PKG)_VERBUILD := 3.0.1270 +$(PKG)_CHECKSUM := e80a3a4326b649ed6585c0ce312ed6dd68942834 +$(PKG)_SUBDIR := $(PKG)--$($(PKG)_VERBUILD)-source-only +$(PKG)_FILE := $(PKG)--$($(PKG)_VERBUILD)-source-only.zip +$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)-$($(PKG)_VERSION)/$($(PKG)_FILE) +$(PKG)_DEPS := gcc boost + +define $(PKG)_UPDATE + $(WGET) -q -O- "http://sourceforge.net/projects/assimp/files/assimp/" | \ + grep 'assimp/files/assimp' | \ + $(SED) -n 's,.*assimp/\([0-9][^>]*\)/.*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && cmake . \ + -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ + -DBUILD_ASSIMP_TOOLS=OFF \ + -DBUILD_ASSIMP_SAMPLES=OFF + $(MAKE) -C '$(1)' -j '$(JOBS)' install VERBOSE=1 + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-assimp.exe' \ + `'$(TARGET)-pkg-config' assimp --cflags --libs` +endef |