Репозиторий Sisyphus
Последнее обновление: 22 октября 2019 | Пакетов: 17517 | Посещений: 15398687
en ru br
Репозитории ALT

Группа :: Графика
Пакет: assimp

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: assimp-3.3.1-mga-fdr-system-poly2tri-clipper.patch
Скачать


Index: assimp-3.2/CMakeLists.txt
===================================================================
--- assimp-3.2/CMakeLists.txt
+++ assimp-3.2/CMakeLists.txt	2016-01-13 23:15:22.085868019 +0100
@@ -178,6 +178,28 @@
   PKG_CHECK_MODULES(UNZIP minizip)
 ENDIF (PKG_CONFIG_FOUND)
 
+# Search for poly2tri
+FIND_LIBRARY(POLY2TRI_LIB poly2tri HINTS ${POLY2TRI_LIB_PATH})
+FIND_FILE(POLY2TRI_H poly2tri.h PATHS ${POLY2TRI_INCLUDE_PATH})
+IF (POLY2TRI_LIB AND POLY2TRI_H)
+  MESSAGE(STATUS "Found external poly2tri")
+  SET(HAVE_POLY2TRI true)
+ELSE(POLY2TRI_LIB AND POLY2TRI_H)
+  MESSAGE(STATUS "Using embedded poly2tri headers")
+  SET(HAVE_POLY2TRI false)
+ENDIF(POLY2TRI_LIB AND POLY2TRI_H)
+
+# Search for clipper (polyclipping)
+FIND_LIBRARY(CLIPPER_LIB polyclipping HINTS ${CLIPPER_LIB_PATH})
+FIND_FILE(CLIPPER_H clipper.hpp PATHS ${CLIPPER_INCLUDE_PATH})
+IF (CLIPPER_LIB AND CLIPPER_H)
+  message(STATUS "Found external clipper (polyclipping)")
+  SET(HAVE_CLIPPER true)
+ELSE(CLIPPER_LIB AND CLIPPER_H)
+  MESSAGE(STATUS "Using embedded clipper headers")
+  SET(HAVE_CLIPPER false)
+ENDIF(CLIPPER_LIB AND CLIPPER_H)
+
 IF ( ASSIMP_NO_EXPORT )
   ADD_DEFINITIONS( -DASSIMP_BUILD_NO_EXPORT)
   MESSAGE( STATUS "Build an import-only version of Assimp." )
Index: assimp-3.2/code/BlenderTessellator.h
===================================================================
--- assimp-3.2/code/BlenderTessellator.h
+++ assimp-3.2/code/BlenderTessellator.h	2016-01-13 23:13:39.574393175 +0100
@@ -142,7 +142,7 @@
 
 #if ASSIMP_BLEND_WITH_POLY_2_TRI
 
-#include "../contrib/poly2tri/poly2tri/poly2tri.h"
+#include <poly2tri.h>
 
 namespace Assimp
 {
Index: assimp-3.2/code/CMakeLists.txt
===================================================================
--- assimp-3.2/code/CMakeLists.txt
+++ assimp-3.2/code/CMakeLists.txt	2016-01-13 23:14:56.293006884 +0100
@@ -665,6 +665,14 @@
   SET (unzip_compile_SRCS ${unzip_SRCS})
 endif (UNZIP_FOUND)
 
+if (HAVE_POLY2TRI)
+   SET (Poly2Tri_SRCS "")
+endif (HAVE_POLY2TRI)
+
+if (HAVE_CLIPPER)
+   SET (Clipper_SRCS "")
+endif (HAVE_CLIPPER)
+
 MESSAGE(STATUS "Enabled formats:${ASSIMP_IMPORTERS_ENABLED}")
 MESSAGE(STATUS "Disabled formats:${ASSIMP_IMPORTERS_DISABLED}")
 
@@ -761,6 +769,18 @@
   INCLUDE_DIRECTORIES("../")
 endif (UNZIP_FOUND)
 
+if (HAVE_POLY2TRI)
+  INCLUDE_DIRECTORIES(${POLY2TRI_INCLUDE_PATH})
+  TARGET_LINK_LIBRARIES(assimp ${POLY2TRI_LIB})
+endif(HAVE_POLY2TRI)
+
+if (HAVE_CLIPPER)
+  INCLUDE_DIRECTORIES(${CLIPPER_INCLUDE_PATH})
+  TARGET_LINK_LIBRARIES(assimp ${CLIPPER_LIB})
+else (HAVE_CLIPPER)
+  INCLUDE_DIRECTORIES(../contrib/clipper)
+endif(HAVE_CLIPPER)
+
 INSTALL( TARGETS assimp
   LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
   ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
Index: assimp-3.2/code/IFCGeometry.cpp
===================================================================
--- assimp-3.2/code/IFCGeometry.cpp
+++ assimp-3.2/code/IFCGeometry.cpp	2016-01-13 23:15:40.893037487 +0100
@@ -49,8 +49,8 @@
 #include "PolyTools.h"
 #include "ProcessHelper.h"
 
-#include "../contrib/poly2tri/poly2tri/poly2tri.h"
-#include "../contrib/clipper/clipper.hpp"
+#include <poly2tri.h>
+#include <clipper.hpp>
 #include <memory>
 
 #include <iterator>
Index: assimp-3.2/code/IFCOpenings.cpp
===================================================================
--- assimp-3.2/code/IFCOpenings.cpp
+++ assimp-3.2/code/IFCOpenings.cpp	2016-01-13 23:16:00.803158148 +0100
@@ -49,8 +49,8 @@
 #include "PolyTools.h"
 #include "ProcessHelper.h"
 
-#include "../contrib/poly2tri/poly2tri/poly2tri.h"
-#include "../contrib/clipper/clipper.hpp"
+#include <poly2tri.h>
+#include <clipper.hpp>
 
 #include <iterator>
 
Index: assimp-3.2/tools/assimp_cmd/CMakeLists.txt
===================================================================
--- assimp-3.2/tools/assimp_cmd/CMakeLists.txt
+++ assimp-3.2/tools/assimp_cmd/CMakeLists.txt	2016-01-13 23:16:45.233195522 +0100
@@ -28,7 +28,7 @@
     MAIN_DEPENDENCY assimp)
 ENDIF( WIN32 )
 
-TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES} )
+TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES} ${POLY2TRI_LIB})
 SET_TARGET_PROPERTIES( assimp_cmd PROPERTIES
   OUTPUT_NAME assimp
 )
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin