From 67d2956a0724089724ccc9a05cd86ef1bf6bbfa1 Mon Sep 17 00:00:00 2001 From: Kenneth Fong Date: Fri, 23 Sep 2022 22:52:36 -0700 Subject: [PATCH 1/2] build.sh - update conan repo http url - check for sdk directory existence before downloading fbx SDK - add --build=missing for building all the missing libs - fix compilation error zlib bump up version for C99 violation fmt use other repo due to permission error - introduced FBXSDK_INCLUDE_DIR for fbxsdk.h not found --- build.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 build.sh diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..fa9eb1a --- /dev/null +++ b/build.sh @@ -0,0 +1,39 @@ + +function kkrun() { + echo "$*" + eval "$*" +} + +# Determine SDK location & build settings for Linux vs (Recent) Mac OS X +if [[ "$OSTYPE" == "darwin"* ]]; then + export CONAN_CONFIG="-s compiler=apple-clang -s compiler.version=10.0 -s compiler.libcxx=libc++" + export FBXSDK_TARBALL="https://github.com/zellski/FBXSDK-Darwin/archive/2019.2.tar.gz" + export FBXSDK_INCLUDE_DIR="$PWD/../FBX2glTF/sdk/Darwin/2019.2/include" +elif [[ "$OSTYPE" == "linux"* ]]; then + export CONAN_CONFIG="-s compiler.libcxx=libstdc++11" + export FBXSDK_TARBALL="https://github.com/zellski/FBXSDK-Linux/archive/2019.2.tar.gz" + export FBXSDK_INCLUDE_DIR="$PWD/../FBX2glTF/sdk/Darwin/2019.2/include" +else + echo "This snippet only handles Mac OS X and Linux." +fi + +echo "export CONAN_CONFIG=\"$CONAN_CONFIG\"" +echo "export FBXSDK_TARBALL=\"$FBXSDK_TARBALL\"" +echo "export FBXSDK_INCLUDE_DIR=\"$FBXSDK_INCLUDE_DIR\"" + +if [ ! -d "sdk" ]; then + echo "[Fetch and unpack FBX SDK]" + echo "curl -sL '${FBXSDK_TARBALL}' | tar xz --strip-components=1 --include */sdk/" + curl -sL "${FBXSDK_TARBALL}" | tar xz --strip-components=1 --include */sdk/ + echo "[Then decompress the contents]" + kkrun "zstd -d -r --rm sdk" +fi + +echo "[Install and configure Conan, if needed]" +kkrun "pip3 install conan" # or sometimes just "pip"; you may need to install Python/PIP +kkrun "conan remote add --force bincrafters https://bincrafters.jfrog.io/artifactory/api/conan/public-conan" +kkrun "conan config set general.revisions_enabled=1" + +echo "[Initialize & run build]" +kkrun "conan install . -i build -s build_type=Release ${CONAN_CONFIG} --build=missing" +kkrun "conan build . -bf build" From a30a83282985c29f513ddf029a9d4c0db30bfc15 Mon Sep 17 00:00:00 2001 From: Kenneth Fong Date: Fri, 23 Sep 2022 22:54:40 -0700 Subject: [PATCH 2/2] Update conanfile.py --- conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index be675d0..2841714 100644 --- a/conanfile.py +++ b/conanfile.py @@ -11,9 +11,9 @@ class FBX2glTFConan(ConanFile): requires = ( ("boost_filesystem/1.69.0@bincrafters/stable"), ("libiconv/1.15@bincrafters/stable"), - ("zlib/1.2.11@conan/stable"), + ("zlib/1.2.12@conan/stable"), ("libxml2/2.9.9@bincrafters/stable"), - ("fmt/5.3.0@bincrafters/stable"), + ("fmt/5.3.0"), ) generators = "cmake_find_package", "cmake_paths"