Skip to content

Commit

Permalink
IO_Assimp: WIP2
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Nov 8, 2023
1 parent 5837399 commit 39f5b62
Show file tree
Hide file tree
Showing 5 changed files with 372 additions and 264 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ jobs:
echo "GH_CASCADE_INC_DIR=$GH_CASCADE_INC_DIR" >> $GITHUB_ENV
echo "GH_CASCADE_LIB_DIR=$GH_CASCADE_LIB_DIR" >> $GITHUB_ENV
- name: Install Assimp
run: |
sudo apt-get install -y install libassimp-dev
GH_ASSIMP_INC_DIR=`dpkg -L libassimp-dev | grep -i "version.h" | sed "s/\/version.h//i"`
GH_ASSIMP_LIB_DIR=`dpkg -L libassimp-dev | grep -i "libassimp.so" | sed "s/\/libassimp.so//i"`
echo "GH_ASSIMP_INC_DIR=$GH_ASSIMP_INC_DIR" >> $GITHUB_ENV
echo "GH_ASSIMP_LIB_DIR=$GH_ASSIMP_LIB_DIR" >> $GITHUB_ENV
- name: Get count of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
Expand All @@ -44,9 +52,17 @@ jobs:
cd ${{github.workspace}}/build
echo CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}}
echo CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}}
echo ASSIMP_INC_DIR=${{env.GH_ASSIMP_INC_DIR}}
echo ASSIMP_LIB_DIR=${{env.GH_ASSIMP_LIB_DIR}}
[ ! -d $CASCADE_INC_DIR ] && echo "ERROR: OpenCascade include dir doesn't exist"
[ ! -d $CASCADE_LIB_DIR ] && echo "ERROR: OpenCascade lib dir doesn't exist"
qmake .. CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}} CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}} CONFIG+=withtests
[ ! -d $ASSIMP_INC_DIR ] && echo "ERROR: assimp include dir doesn't exist"
[ ! -d $ASSIMP_LIB_DIR ] && echo "ERROR: assimp lib dir doesn't exist"
qmake .. CONFIG+=withtests \
CASCADE_INC_DIR=${{env.GH_CASCADE_INC_DIR}} \
CASCADE_LIB_DIR=${{env.GH_CASCADE_LIB_DIR}} \
ASSIMP_INC_DIR=${{env.GH_ASSIMP_INC_DIR}} \
ASSIMP_LIB_DIR=${{env.GH_ASSIMP_LIB_DIR}}
make -j${{steps.cpu-cores.outputs.count}}
- name: Execute Unit Tests
Expand Down
45 changes: 25 additions & 20 deletions mayo.pro
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,31 @@ LIBS += -lTKVRML
SOURCES -= src/io_occ/io_occ_vrml_reader.cpp
}

# assimp
isEmpty(ASSIMP_INC_DIR) | isEmpty(ASSIMP_LIB_DIR) {
message(assimp OFF)
} else {
message(assimp ON)

HEADERS += $$files(src/io_assimp/*.h)
SOURCES += $$files(src/io_assimp/*.cpp)

INCLUDEPATH += $$ASSIMP_INC_DIR
LIBS += -L$$ASSIMP_LIB_DIR
win32 {
CONFIG(debug, debug|release) {
LIBS += -lassimp-vc142-mtd -lzlibstaticd
} else {
LIBS +=-lassimp-vc142-mtd -lzlibstatic
}
}
else {
LIBS += -lassimp
}

DEFINES += HAVE_ASSIMP
}

# gmio
isEmpty(GMIO_ROOT) {
message(gmio OFF)
Expand All @@ -227,26 +252,6 @@ isEmpty(GMIO_ROOT) {
DEFINES += HAVE_GMIO
}

# assimp
isEmpty(ASSIMP_ROOT) {
message(assimp OFF)
} else {
message(assimp ON)

HEADERS += $$files(src/io_assimp/*.h)
SOURCES += $$files(src/io_assimp/*.cpp)

INCLUDEPATH += $$ASSIMP_ROOT/include
LIBS += -L$$ASSIMP_ROOT/lib
CONFIG(debug, debug|release) {
LIBS += -lassimp-vc142-mtd -lzlibstaticd
} else {
LIBS +=-lassimp-vc142-mtd -lzlibstatic
}

DEFINES += HAVE_ASSIMP
}

# Unit tests
CONFIG(withtests) {
include(tests/tests.pri)
Expand Down
2 changes: 1 addition & 1 deletion src/base/io_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Span<std::string_view> formatFileSuffixes(Format format)
static std::string_view suffix_3ds[] = { "3ds" };
static std::string_view suffix_3mf[] = { "3mf" };
static std::string_view suffix_amf[] = { "amf" };
static std::string_view suffix_collada[] = { "dae" };
static std::string_view suffix_collada[] = { "dae", "zae" };
static std::string_view suffix_dxf[] = { "dxf" };
static std::string_view suffix_fbx[] = { "fbx" };
static std::string_view suffix_gltf[] = { "gltf", "glb" };
Expand Down
Loading

0 comments on commit 39f5b62

Please sign in to comment.