From 0456d3d5bb4a78a45badb4a1b76b2f263eda5b10 Mon Sep 17 00:00:00 2001 From: Garux Date: Thu, 4 Dec 2025 04:20:08 +0500 Subject: [PATCH] better handling of ASSIMP_INTERNAL 4705d56a8408424012c662b0211560fddc25fa3a --- Makefile | 10 +++++----- plugins/assmodel/mdlimage.cpp | 4 ++-- plugins/assmodel/model.cpp | 8 ++++---- plugins/assmodel/plugin.cpp | 14 +++++++------- tools/quake3/q3map2/model.cpp | 18 +++++++++--------- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 8a7f74d0..0878a40a 100644 --- a/Makefile +++ b/Makefile @@ -90,11 +90,11 @@ ASSIMP_INTERNAL ?= no CPPFLAGS_ASSIMP ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) assimp --cflags $(STDERR_TO_DEVNULL)) LIBS_ASSIMP ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) assimp --libs-only-L --libs-only-l $(STDERR_TO_DEVNULL)) ifneq ($(ASSIMP_INTERNAL),yes) -CPPFLAGS_ASSIMP := $(CPPFLAGS_ASSIMP) +CPPFLAGS_ASSIMP := $(CPPFLAGS_ASSIMP) -DASSIMP_INCLUDE\(x\)=\ LIBS_ASSIMP := $(LIBS_ASSIMP) else -CPPFLAGS_ASSIMP := -Ilibs/assimp/include -LIBS_ASSIMP := -lassimp_ +CPPFLAGS_ASSIMP := -Ilibs/assimp/include -DASSIMP_INCLUDE\(x\)=\#x +LIBS_ASSIMP := -lassimp_ -L$(INSTALLDIR) endif CPPFLAGS_GL ?= LIBS_GL ?= -lGL # -lopengl32 on Win32 @@ -542,7 +542,7 @@ ifeq ($(ASSIMP_INTERNAL),yes) $(INSTALLDIR)/q3map2.$(EXE): LDFLAGS_EXTRA += -Wl,-rpath '-Wl,$$ORIGIN' endif endif -$(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_JPEG) $(LIBS_ZLIB) $(LIBS_ASSIMP) -L$(INSTALLDIR) +$(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_JPEG) $(LIBS_ZLIB) $(LIBS_ASSIMP) $(INSTALLDIR)/q3map2.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) $(CPPFLAGS_JPEG) -Itools/quake3/common -Ilibs -Iinclude $(CPPFLAGS_ASSIMP) $(INSTALLDIR)/q3map2.$(EXE): \ tools/quake3/common/cmdlib.o \ @@ -1084,7 +1084,7 @@ ifeq ($(ASSIMP_INTERNAL),yes) $(INSTALLDIR)/modules/assmodel.$(DLL): LDFLAGS_EXTRA := -Wl,-rpath '-Wl,$$ORIGIN/..' endif endif -$(INSTALLDIR)/modules/assmodel.$(DLL): LIBS_EXTRA := $(LIBS_ASSIMP) -L$(INSTALLDIR) +$(INSTALLDIR)/modules/assmodel.$(DLL): LIBS_EXTRA := $(LIBS_ASSIMP) $(INSTALLDIR)/modules/assmodel.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude $(CPPFLAGS_ASSIMP) $(CPPFLAGS_QTGUI) $(INSTALLDIR)/modules/assmodel.$(DLL): \ plugins/assmodel/mdlimage.o \ diff --git a/plugins/assmodel/mdlimage.cpp b/plugins/assmodel/mdlimage.cpp index d5d3e369..a5d0eb63 100644 --- a/plugins/assmodel/mdlimage.cpp +++ b/plugins/assmodel/mdlimage.cpp @@ -23,8 +23,8 @@ #include "imagelib.h" -#include "assimp/Importer.hpp" -#include "assimp/scene.h" +#include ASSIMP_INCLUDE(assimp/Importer.hpp) +#include ASSIMP_INCLUDE(assimp/scene.h) Image* LoadMDLImage( Assimp::Importer& importer, ArchiveFile& file ){ diff --git a/plugins/assmodel/model.cpp b/plugins/assmodel/model.cpp index 5d0aca17..8ad5bae8 100644 --- a/plugins/assmodel/model.cpp +++ b/plugins/assmodel/model.cpp @@ -40,10 +40,10 @@ #include "traverselib.h" #include "render.h" -#include "assimp/Importer.hpp" -#include "assimp/postprocess.h" -#include "assimp/scene.h" -#include "assimp/mesh.h" +#include ASSIMP_INCLUDE(assimp/Importer.hpp) +#include ASSIMP_INCLUDE(assimp/postprocess.h) +#include ASSIMP_INCLUDE(assimp/scene.h) +#include ASSIMP_INCLUDE(assimp/mesh.h) #include "os/path.h" #include "stream/stringstream.h" diff --git a/plugins/assmodel/plugin.cpp b/plugins/assmodel/plugin.cpp index a35ec3f2..b29e2b6f 100644 --- a/plugins/assmodel/plugin.cpp +++ b/plugins/assmodel/plugin.cpp @@ -45,13 +45,13 @@ typedef unsigned char byte; #include "model.h" -#include "assimp/Importer.hpp" -#include "assimp/importerdesc.h" -#include "assimp/Logger.hpp" -#include "assimp/DefaultLogger.hpp" -#include "assimp/IOSystem.hpp" -#include "assimp/MemoryIOWrapper.h" -#include "assimp/mesh.h" +#include ASSIMP_INCLUDE(assimp/Importer.hpp) +#include ASSIMP_INCLUDE(assimp/importerdesc.h) +#include ASSIMP_INCLUDE(assimp/Logger.hpp) +#include ASSIMP_INCLUDE(assimp/DefaultLogger.hpp) +#include ASSIMP_INCLUDE(assimp/IOSystem.hpp) +#include ASSIMP_INCLUDE(assimp/MemoryIOWrapper.h) +#include ASSIMP_INCLUDE(assimp/mesh.h) #include "iarchive.h" #include "idatastream.h" #include "mdlimage.h" diff --git a/tools/quake3/q3map2/model.cpp b/tools/quake3/q3map2/model.cpp index ebdeabe3..ffc93c1a 100644 --- a/tools/quake3/q3map2/model.cpp +++ b/tools/quake3/q3map2/model.cpp @@ -34,15 +34,15 @@ #include "model.h" #include "qspatial.h" -#include "assimp/Importer.hpp" -#include "assimp/importerdesc.h" -#include "assimp/Logger.hpp" -#include "assimp/DefaultLogger.hpp" -#include "assimp/IOSystem.hpp" -#include "assimp/MemoryIOWrapper.h" -#include "assimp/postprocess.h" -#include "assimp/scene.h" -#include "assimp/mesh.h" +#include ASSIMP_INCLUDE(assimp/Importer.hpp) +#include ASSIMP_INCLUDE(assimp/importerdesc.h) +#include ASSIMP_INCLUDE(assimp/Logger.hpp) +#include ASSIMP_INCLUDE(assimp/DefaultLogger.hpp) +#include ASSIMP_INCLUDE(assimp/IOSystem.hpp) +#include ASSIMP_INCLUDE(assimp/MemoryIOWrapper.h) +#include ASSIMP_INCLUDE(assimp/postprocess.h) +#include ASSIMP_INCLUDE(assimp/scene.h) +#include ASSIMP_INCLUDE(assimp/mesh.h) #include