aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorras0219 <533828+ras0219@users.noreply.github.com>2020-09-09 20:40:15 -0700
committerGitHub <noreply@github.com>2020-09-09 20:40:15 -0700
commitf6df03b4a819bf78bc0cdf8b2369ffffc44cd894 (patch)
treeae3b16c8082f8202e9a01004e4b17cfdcfd52658
parent32b6c3a134022db7b985ed5f7d1f2ff13a96a140 (diff)
downloadvcpkg-f6df03b4a819bf78bc0cdf8b2369ffffc44cd894.tar.gz
vcpkg-f6df03b4a819bf78bc0cdf8b2369ffffc44cd894.zip
[assimp][irrxml][kubazip][poly2tri][polyclipping] Extract vendored dependencies (#13264)
* [assimp] Fix -config.cmake files * [assimp] Fix linux build and provide backwards-compatible alias * [assimp][irrxml][kubazip][poly2tri][polyclipping] Extract vendored dependencies * [assimp] Use find_dependency(); add ZLIB dependency * [polyclipping] Do not suffix upstream binaries Co-authored-by: Robert Schumacher <roschuma@microsoft.com> Co-authored-by: Stefano Sinigardi <stesinigardi@hotmail.com>
-rw-r--r--ports/assimp/CONTROL9
-rw-r--r--ports/assimp/build_fixes.patch628
-rw-r--r--ports/assimp/cmake-policy.patch13
-rw-r--r--ports/assimp/config.patch111
-rw-r--r--ports/assimp/fix-static-build-error.patch13
-rw-r--r--ports/assimp/fix_minizip.patch32
-rw-r--r--ports/assimp/portfile.cmake69
-rw-r--r--ports/assimp/uninitialized-variable.patch13
-rw-r--r--ports/irrxml/CMakeLists.txt56
-rw-r--r--ports/irrxml/disable_asm_calls.patch20
-rw-r--r--ports/irrxml/portfile.cmake22
-rw-r--r--ports/irrxml/vcpkg.json6
-rw-r--r--ports/kubazip/CONTROL4
-rw-r--r--ports/kubazip/fix_targets.patch52
-rw-r--r--ports/kubazip/portfile.cmake22
-rw-r--r--ports/poly2tri/CMakeLists.txt57
-rw-r--r--ports/poly2tri/CONTROL5
-rw-r--r--ports/poly2tri/portfile.cmake26
-rw-r--r--ports/polyclipping/CONTROL3
-rw-r--r--ports/polyclipping/FindCLIPPER.cmake45
-rw-r--r--ports/polyclipping/fix_targets.patch16
-rw-r--r--ports/polyclipping/portfile.cmake6
-rw-r--r--ports/polyclipping/vcpkg-cmake-wrapper.cmake10
23 files changed, 1124 insertions, 114 deletions
diff --git a/ports/assimp/CONTROL b/ports/assimp/CONTROL
index c0abca67c..be6613ec9 100644
--- a/ports/assimp/CONTROL
+++ b/ports/assimp/CONTROL
@@ -1,5 +1,6 @@
-Source: assimp
+Source: assimp
Version: 5.0.1
-Homepage: https://github.com/assimp/assimp
-Description: The Open Asset import library
-Build-Depends: zlib, rapidjson, minizip
+Port-Version: 1
+Homepage: https://github.com/assimp/assimp
+Description: The Open Asset import library
+Build-Depends: zlib, rapidjson, minizip, stb, kubazip, irrxml, polyclipping, utfcpp, poly2tri
diff --git a/ports/assimp/build_fixes.patch b/ports/assimp/build_fixes.patch
new file mode 100644
index 000000000..ed7bcfaa3
--- /dev/null
+++ b/ports/assimp/build_fixes.patch
@@ -0,0 +1,628 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index dcafb64..4b131cc 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -130,6 +130,17 @@ OPTION ( IGNORE_GIT_HASH
+ OFF
+ )
+
++find_package(Stb REQUIRED)
++include_directories(${Stb_INCLUDE_DIR})
++find_package(irrXML CONFIG REQUIRED)
++find_path(UTF8_INCLUDE_DIRS "utf8.h")
++include_directories(${UTF8_INCLUDE_DIRS})
++find_package(RapidJSON CONFIG REQUIRED)
++include_directories(${RAPIDJSON_INCLUDE_DIRS})
++find_path(UNZIP_INCLUDE_DIRS "minizip/unzip.h")
++include_directories(${UNZIP_INCLUDE_DIRS}/minizip)
++include_directories(${CMAKE_CURRENT_SOURCE_DIR}/contrib)
++
+ IF (IOS AND NOT HUNTER_ENABLED)
+ IF (NOT CMAKE_BUILD_TYPE)
+ SET(CMAKE_BUILD_TYPE "Release")
+@@ -230,10 +241,8 @@ SET(LIBASSIMP-DEV_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_M
+ SET(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev)
+ SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names")
+
+-IF( UNIX )
+ # Use GNUInstallDirs for Unix predefined directories
+ INCLUDE(GNUInstallDirs)
+-ENDIF( UNIX )
+
+ # Grouped compiler settings
+ IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT CMAKE_COMPILER_IS_MINGW)
+@@ -253,7 +262,7 @@ ELSEIF(MSVC)
+ IF(MSVC12)
+ ADD_COMPILE_OPTIONS(/wd4351)
+ ENDIF()
+- SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob2 /DEBUG:FULL /Zi")
++# SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob2 /DEBUG:FULL /Zi")
+ ELSEIF ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+ IF(NOT HUNTER_ENABLED)
+ SET(CMAKE_CXX_FLAGS "-fPIC -std=c++11 ${CMAKE_CXX_FLAGS}")
+@@ -352,35 +361,17 @@ IF (NOT TARGET uninstall)
+ ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
+ ENDIF()
+
+-IF(HUNTER_ENABLED)
+- set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
++ set(CONFIG_INSTALL_DIR "share/assimp")
+ set(INCLUDE_INSTALL_DIR "include")
+
+- set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
+-
+- # Configuration
+- set(VERSION_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
+- set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}Config.cmake")
+- set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
+- set(NAMESPACE "${PROJECT_NAME}::")
++ set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Config")
++ set(NAMESPACE "assimp::")
+
+ # Include module with fuction 'write_basic_package_version_file'
+ include(CMakePackageConfigHelpers)
+
+- # Note: PROJECT_VERSION is used as a VERSION
+- write_basic_package_version_file("${VERSION_CONFIG}" COMPATIBILITY SameMajorVersion)
+-
+- # Use variables:
+- # * TARGETS_EXPORT_NAME
+- # * PROJECT_NAME
+- configure_package_config_file(
+- "cmake/assimp-hunter-config.cmake.in"
+- "${PROJECT_CONFIG}"
+- INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}"
+- )
+-
+ install(
+- FILES "${PROJECT_CONFIG}" "${VERSION_CONFIG}"
++ FILES ${VERSION_CONFIG}
+ DESTINATION "${CONFIG_INSTALL_DIR}"
+ )
+
+@@ -389,30 +380,6 @@ IF(HUNTER_ENABLED)
+ NAMESPACE "${NAMESPACE}"
+ DESTINATION "${CONFIG_INSTALL_DIR}"
+ )
+-ELSE(HUNTER_ENABLED)
+- # cmake configuration files
+- CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" @ONLY IMMEDIATE)
+- CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake" @ONLY IMMEDIATE)
+- IF (is_multi_config)
+- CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-debug.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" @ONLY IMMEDIATE)
+- CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-release.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake" @ONLY IMMEDIATE)
+- SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake")
+- ELSEIF (CMAKE_BUILD_TYPE STREQUAL Debug)
+- CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-debug.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" @ONLY IMMEDIATE)
+- SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake")
+- ELSE()
+- CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-release.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake" @ONLY IMMEDIATE)
+- SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake")
+- ENDIF()
+- CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE)
+- #we should generated these scripts after CMake VERSION 3.0.2 using export(EXPORT ...) and write_basic_package_version_file(...)
+- INSTALL(FILES
+- "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake"
+- "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake"
+- "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake"
+- ${PACKAGE_TARGETS_FILE}
+- DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT})
+-ENDIF(HUNTER_ENABLED)
+
+ FIND_PACKAGE( DirectX )
+
+@@ -422,63 +389,19 @@ ENDIF( BUILD_DOCS )
+
+ # Look for system installed irrXML
+ IF ( SYSTEM_IRRXML )
+- FIND_PACKAGE( IrrXML REQUIRED )
++ FIND_PACKAGE( irrXML REQUIRED )
+ ENDIF( SYSTEM_IRRXML )
+
+ # Search for external dependencies, and build them from source if not found
+ # Search for zlib
+-IF(HUNTER_ENABLED)
+- hunter_add_package(ZLIB)
+- find_package(ZLIB CONFIG REQUIRED)
++ find_package(ZLIB REQUIRED)
+
+ add_definitions(-DASSIMP_BUILD_NO_OWN_ZLIB)
+ set(ZLIB_FOUND TRUE)
+- set(ZLIB_LIBRARIES ZLIB::zlib)
+- set(ASSIMP_BUILD_MINIZIP TRUE)
+-ELSE(HUNTER_ENABLED)
+- IF ( NOT ASSIMP_BUILD_ZLIB )
+- FIND_PACKAGE(ZLIB)
+- ENDIF( NOT ASSIMP_BUILD_ZLIB )
+-
+- IF( NOT ZLIB_FOUND )
+- MESSAGE(STATUS "compiling zlib from sources")
+- INCLUDE(CheckIncludeFile)
+- INCLUDE(CheckTypeSize)
+- INCLUDE(CheckFunctionExists)
+-
+- # Explicitly turn off ASM686 and AMD64 cmake options.
+- # The AMD64 option causes a build failure on MSVC and the ASM builds seem to have problems:
+- # https://github.com/madler/zlib/issues/41#issuecomment-125848075
+- # Also prevents these options from "polluting" the cmake options if assimp is being
+- # included as a submodule.
+- set( ASM686 FALSE CACHE INTERNAL "Override ZLIB flag to turn off assembly" FORCE )
+- set( AMD64 FALSE CACHE INTERNAL "Override ZLIB flag to turn off assembly" FORCE )
+-
+- # compile from sources
+- ADD_SUBDIRECTORY(contrib/zlib)
+- SET(ZLIB_FOUND 1)
+- SET(ZLIB_LIBRARIES zlibstatic)
+- SET(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib)
+- # need to ensure we don't link with system zlib or minizip as well.
+- SET(ASSIMP_BUILD_MINIZIP 1)
+- ELSE(NOT ZLIB_FOUND)
+- ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB)
+- SET(ZLIB_LIBRARIES_LINKED -lz)
+- ENDIF(NOT ZLIB_FOUND)
++ set(ZLIB_LIBRARIES ZLIB::ZLIB)
+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
+-ENDIF(HUNTER_ENABLED)
+
+-IF( NOT IOS )
+- IF( NOT ASSIMP_BUILD_MINIZIP )
+- use_pkgconfig(UNZIP minizip)
+- ENDIF( NOT ASSIMP_BUILD_MINIZIP )
+-ELSE ( NOT IOS )
+- IF( NOT BUILD_SHARED_LIBS )
+- IF( NOT ASSIMP_BUILD_MINIZIP )
+- use_pkgconfig(UNZIP minizip)
+- ENDIF( NOT ASSIMP_BUILD_MINIZIP )
+- ENDIF ( NOT BUILD_SHARED_LIBS )
+-ENDIF ( NOT IOS )
++ find_package(minizip CONFIG REQUIRED)
+
+ IF ( ASSIMP_NO_EXPORT )
+ ADD_DEFINITIONS( -DASSIMP_BUILD_NO_EXPORT)
+@@ -633,7 +556,7 @@ IF(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES)
+ INCLUDE(DebSourcePPA)
+ ENDIF()
+
+-if(WIN32)
++if(0)
+ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin64/")
+ SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib64/")
+@@ -677,4 +600,4 @@ if(WIN32)
+ ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb VERBATIM)
+ ENDIF()
+ ENDIF(MSVC12 OR MSVC14 OR MSVC15 )
+-ENDIF (WIN32)
++ENDIF (0)
+diff --git a/assimpTargets.cmake.in b/assimpTargets.cmake.in
+index ab1a8d2..4b0729b 100644
+--- a/assimpTargets.cmake.in
++++ b/assimpTargets.cmake.in
+@@ -5,6 +5,8 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
+ endif()
+ cmake_policy(PUSH)
+ cmake_policy(VERSION 2.6)
++# Required for the evaluation of "if(@BUILD_SHARED_LIBS@)" below to function
++cmake_policy(SET CMP0012 NEW)
+ #----------------------------------------------------------------
+ # Generated CMake target import file.
+ #----------------------------------------------------------------
+diff --git a/code/3MF/D3MFExporter.cpp b/code/3MF/D3MFExporter.cpp
+index 1f388ad..1ccd2aa 100644
+--- a/code/3MF/D3MFExporter.cpp
++++ b/code/3MF/D3MFExporter.cpp
+@@ -58,7 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #ifdef ASSIMP_USE_HUNTER
+ # include <zip/zip.h>
+ #else
+-# include <contrib/zip/src/zip.h>
++# include <zip/zip.h>
+ #endif
+
+ namespace Assimp {
+@@ -255,7 +255,7 @@ void D3MFExporter::writeBaseMaterials() {
+ hexDiffuseColor.clear();
+ tmp.clear();
+ hexDiffuseColor = "#";
+-
++
+ tmp = DecimalToHexa( color.r );
+ hexDiffuseColor += tmp;
+ tmp = DecimalToHexa( color.g );
+diff --git a/code/Blender/BlenderTessellator.h b/code/Blender/BlenderTessellator.h
+index 518e56c..ec4a653 100644
+--- a/code/Blender/BlenderTessellator.h
++++ b/code/Blender/BlenderTessellator.h
+@@ -147,7 +147,7 @@ namespace Assimp
+ #ifdef ASSIMP_USE_HUNTER
+ # include <poly2tri/poly2tri.h>
+ #else
+-# include "../contrib/poly2tri/poly2tri/poly2tri.h"
++# include <poly2tri/poly2tri.h>
+ #endif
+
+ namespace Assimp
+diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
+index 55538d9..4f9b479 100644
+--- a/code/CMakeLists.txt
++++ b/code/CMakeLists.txt
+@@ -862,89 +862,24 @@ SET( Extra_SRCS
+ SOURCE_GROUP( Extra FILES ${Extra_SRCS})
+
+ # irrXML
+-IF(HUNTER_ENABLED)
+- hunter_add_package(irrXML)
+ find_package(irrXML CONFIG REQUIRED)
+-ELSE(HUNTER_ENABLED)
+- # irrXML already included in contrib directory by parent CMakeLists.txt.
+-ENDIF(HUNTER_ENABLED)
+-
+-# utf8
+-IF(HUNTER_ENABLED)
+- hunter_add_package(utf8)
+- find_package(utf8 CONFIG REQUIRED)
+-ELSE(HUNTER_ENABLED)
+- # utf8 is header-only, so Assimp doesn't need to do anything.
+-ENDIF(HUNTER_ENABLED)
+
+ # polyclipping
+-IF(HUNTER_ENABLED)
+- hunter_add_package(polyclipping)
+ find_package(polyclipping CONFIG REQUIRED)
+-ELSE(HUNTER_ENABLED)
+ SET( Clipper_SRCS
+ ../contrib/clipper/clipper.hpp
+ ../contrib/clipper/clipper.cpp
+ )
+ SOURCE_GROUP( Contrib\\Clipper FILES ${Clipper_SRCS})
+-ENDIF(HUNTER_ENABLED)
+
+ # poly2tri
+-IF(HUNTER_ENABLED)
+- hunter_add_package(poly2tri)
+ find_package(poly2tri CONFIG REQUIRED)
+-ELSE(HUNTER_ENABLED)
+- SET( Poly2Tri_SRCS
+- ../contrib/poly2tri/poly2tri/common/shapes.cc
+- ../contrib/poly2tri/poly2tri/common/shapes.h
+- ../contrib/poly2tri/poly2tri/common/utils.h
+- ../contrib/poly2tri/poly2tri/sweep/advancing_front.h
+- ../contrib/poly2tri/poly2tri/sweep/advancing_front.cc
+- ../contrib/poly2tri/poly2tri/sweep/cdt.cc
+- ../contrib/poly2tri/poly2tri/sweep/cdt.h
+- ../contrib/poly2tri/poly2tri/sweep/sweep.cc
+- ../contrib/poly2tri/poly2tri/sweep/sweep.h
+- ../contrib/poly2tri/poly2tri/sweep/sweep_context.cc
+- ../contrib/poly2tri/poly2tri/sweep/sweep_context.h
+- )
+- SOURCE_GROUP( Contrib\\Poly2Tri FILES ${Poly2Tri_SRCS})
+-ENDIF(HUNTER_ENABLED)
+
+ # minizip/unzip
+-IF(HUNTER_ENABLED)
+- hunter_add_package(minizip)
+ find_package(minizip CONFIG REQUIRED)
+-ELSE(HUNTER_ENABLED)
+- SET( unzip_SRCS
+- ../contrib/unzip/crypt.h
+- ../contrib/unzip/ioapi.c
+- ../contrib/unzip/ioapi.h
+- ../contrib/unzip/unzip.c
+- ../contrib/unzip/unzip.h
+- )
+- SOURCE_GROUP(Contrib\\unzip FILES ${unzip_SRCS})
+-ENDIF(HUNTER_ENABLED)
+
+ # zip (https://github.com/kuba--/zip)
+-IF(HUNTER_ENABLED)
+- hunter_add_package(zip)
+- find_package(zip CONFIG REQUIRED)
+-ELSE(HUNTER_ENABLED)
+- SET( ziplib_SRCS
+- ../contrib/zip/src/miniz.h
+- ../contrib/zip/src/zip.c
+- ../contrib/zip/src/zip.h
+- )
+-
+- # TODO if cmake required version has been updated to >3.12.0, collapse this to the second case only
+- if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
+- add_definitions(-DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=0)
+- else()
+- add_compile_definitions(MINIZ_USE_UNALIGNED_LOADS_AND_STORES=0)
+- endif()
+-
+- SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} )
+-ENDIF(HUNTER_ENABLED)
++ find_package(kubazip CONFIG REQUIRED)
+
+ # openddlparser
+ IF(HUNTER_ENABLED)
+@@ -1021,13 +956,7 @@ ELSE ()
+ ENDIF ()
+
+ # RapidJSON
+-IF(HUNTER_ENABLED)
+- hunter_add_package(RapidJSON)
+ find_package(RapidJSON CONFIG REQUIRED)
+-ELSE(HUNTER_ENABLED)
+- INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" )
+- INCLUDE_DIRECTORIES( "../contrib" )
+-ENDIF(HUNTER_ENABLED)
+
+ # VC2010 fixes
+ if(MSVC10)
+@@ -1044,15 +973,6 @@ if ( MSVC )
+ ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
+ endif ( MSVC )
+
+-IF(NOT HUNTER_ENABLED)
+- if (UNZIP_FOUND)
+- SET (unzip_compile_SRCS "")
+- else (UNZIP_FOUND)
+- SET (unzip_compile_SRCS ${unzip_SRCS})
+- INCLUDE_DIRECTORIES( "../contrib/unzip/" )
+- endif (UNZIP_FOUND)
+-ENDIF(NOT HUNTER_ENABLED)
+-
+ MESSAGE(STATUS "Enabled importer formats:${ASSIMP_IMPORTERS_ENABLED}")
+ MESSAGE(STATUS "Disabled importer formats:${ASSIMP_IMPORTERS_DISABLED}")
+
+@@ -1111,22 +1031,14 @@ TARGET_INCLUDE_DIRECTORIES ( assimp PUBLIC
+ $<INSTALL_INTERFACE:include>
+ )
+
+-IF(HUNTER_ENABLED)
+ TARGET_LINK_LIBRARIES(assimp
+- PUBLIC
+ polyclipping::polyclipping
+ irrXML::irrXML
+- openddlparser::openddl_parser
+- poly2tri::poly2tri
+ minizip::minizip
+- ZLIB::zlib
+- RapidJSON::rapidjson
+- utf8::utf8
+- zip::zip
++ ZLIB::ZLIB
++ kubazip::kubazip
++ poly2tri::poly2tri
+ )
+-ELSE(HUNTER_ENABLED)
+- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} )
+-ENDIF(HUNTER_ENABLED)
+
+ if(ASSIMP_ANDROID_JNIIOSYSTEM)
+ set(ASSIMP_ANDROID_JNIIOSYSTEM_PATH port/AndroidJNI)
+@@ -1208,21 +1121,12 @@ ENDIF(APPLE)
+
+ # Build against external unzip, or add ../contrib/unzip so
+ # assimp can #include "unzip.h"
+-IF(NOT HUNTER_ENABLED)
+- if (UNZIP_FOUND)
+- INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS})
+- TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES})
+- else (UNZIP_FOUND)
+- INCLUDE_DIRECTORIES("../")
+- endif (UNZIP_FOUND)
+-ENDIF(NOT HUNTER_ENABLED)
+
+ # Add RT-extension library for glTF importer with Open3DGC-compression.
+ IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
+ TARGET_LINK_LIBRARIES(assimp ${RT_LIBRARY})
+ ENDIF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
+
+-IF(HUNTER_ENABLED)
+ INSTALL( TARGETS assimp
+ EXPORT "${TARGETS_EXPORT_NAME}"
+ LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
+@@ -1231,14 +1135,6 @@ IF(HUNTER_ENABLED)
+ FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
+ COMPONENT ${LIBASSIMP_COMPONENT}
+ INCLUDES DESTINATION "include")
+-ELSE(HUNTER_ENABLED)
+-INSTALL( TARGETS assimp
+- LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
+- ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
+- RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
+- FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
+- COMPONENT ${LIBASSIMP_COMPONENT})
+-ENDIF(HUNTER_ENABLED)
+ INSTALL( FILES ${PUBLIC_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp COMPONENT assimp-dev)
+ INSTALL( FILES ${COMPILER_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp/Compiler COMPONENT assimp-dev)
+
+diff --git a/code/Common/BaseImporter.cpp b/code/Common/BaseImporter.cpp
+index b77bbfe..51cba43 100644
+--- a/code/Common/BaseImporter.cpp
++++ b/code/Common/BaseImporter.cpp
+@@ -344,7 +344,7 @@ std::string BaseImporter::GetExtension( const std::string& file ) {
+ #ifdef ASSIMP_USE_HUNTER
+ # include <utf8/utf8.h>
+ #else
+-# include "../contrib/utf8cpp/source/utf8.h"
++# include <utf8.h>
+ #endif
+
+ // ------------------------------------------------------------------------------------------------
+@@ -364,8 +364,8 @@ void BaseImporter::ConvertToUTF8(std::vector<char>& data)
+ data.resize(data.size()-3);
+ return;
+ }
+-
+-
++
++
+ // UTF 32 BE with BOM
+ if(*((uint32_t*)&data.front()) == 0xFFFE0000) {
+
+@@ -507,7 +507,7 @@ struct Assimp::BatchData {
+ , next_id(0xffff)
+ , validate( validate ) {
+ ai_assert( nullptr != pIO );
+-
++
+ pImporter = new Importer();
+ pImporter->SetIOHandler( pIO );
+ }
+diff --git a/code/Importer/IFC/IFCGeometry.cpp b/code/Importer/IFC/IFCGeometry.cpp
+index d1c7aee..8e11373 100644
+--- a/code/Importer/IFC/IFCGeometry.cpp
++++ b/code/Importer/IFC/IFCGeometry.cpp
+@@ -51,9 +51,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #ifdef ASSIMP_USE_HUNTER
+ # include <poly2tri/poly2tri.h>
+-# include <polyclipping/clipper.hpp>
++# include "../contrib/clipper/clipper.hpp"
+ #else
+-# include "../contrib/poly2tri/poly2tri/poly2tri.h"
++# include <poly2tri/poly2tri.h>
+ # include "../contrib/clipper/clipper.hpp"
+ #endif
+
+diff --git a/code/Importer/IFC/IFCOpenings.cpp b/code/Importer/IFC/IFCOpenings.cpp
+index d6c40b3..387c625 100644
+--- a/code/Importer/IFC/IFCOpenings.cpp
++++ b/code/Importer/IFC/IFCOpenings.cpp
+@@ -51,9 +51,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #ifdef ASSIMP_USE_HUNTER
+ # include <poly2tri/poly2tri.h>
+-# include <polyclipping/clipper.hpp>
++# include "../contrib/clipper/clipper.hpp"
+ #else
+-# include "../contrib/poly2tri/poly2tri/poly2tri.h"
++# include <poly2tri/poly2tri.h>
+ # include "../contrib/clipper/clipper.hpp"
+ #endif
+
+@@ -911,14 +911,14 @@ size_t CloseWindows(ContourVector& contours,
+ // compare base poly normal and contour normal to detect if we need to reverse the face winding
+ if(curmesh.mVertcnt.size() > 0) {
+ IfcVector3 basePolyNormal = TempMesh::ComputePolygonNormal(curmesh.mVerts.data(), curmesh.mVertcnt.front());
+-
++
+ std::vector<IfcVector3> worldSpaceContourVtx(it->contour.size());
+-
++
+ for(size_t a = 0; a < it->contour.size(); ++a)
+ worldSpaceContourVtx[a] = minv * IfcVector3(it->contour[a].x, it->contour[a].y, 0.0);
+-
++
+ IfcVector3 contourNormal = TempMesh::ComputePolygonNormal(worldSpaceContourVtx.data(), worldSpaceContourVtx.size());
+-
++
+ reverseCountourFaces = (contourNormal * basePolyNormal) > 0.0;
+ }
+
+diff --git a/code/Importer/STEPParser/STEPFileEncoding.cpp b/code/Importer/STEPParser/STEPFileEncoding.cpp
+index 101dcdf..3f12403 100644
+--- a/code/Importer/STEPParser/STEPFileEncoding.cpp
++++ b/code/Importer/STEPParser/STEPFileEncoding.cpp
+@@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #ifdef ASSIMP_USE_HUNTER
+ # include <utf8/utf8.h>
+ #else
+-# include <contrib/utf8cpp/source/utf8.h>
++# include <utf8.h>
+ #endif
+
+ #include <memory>
+diff --git a/code/MMD/MMDPmxParser.cpp b/code/MMD/MMDPmxParser.cpp
+index 80f0986..47725e2 100644
+--- a/code/MMD/MMDPmxParser.cpp
++++ b/code/MMD/MMDPmxParser.cpp
+@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #ifdef ASSIMP_USE_HUNTER
+ # include <utf8/utf8.h>
+ #else
+-# include "../contrib/utf8cpp/source/utf8.h"
++# include <utf8.h>
+ #endif
+ #include <assimp/Exceptional.h>
+
+@@ -102,7 +102,7 @@ namespace pmx
+ const unsigned int targetSize = size * 3; // enough to encode
+ char *targetStart = new char[targetSize];
+ std::memset(targetStart, 0, targetSize * sizeof(char));
+-
++
+ utf8::utf16to8( sourceStart, sourceStart + size/2, targetStart );
+
+ std::string result(targetStart);
+diff --git a/code/SIB/SIBImporter.cpp b/code/SIB/SIBImporter.cpp
+index 20cdc80..46e9a32 100644
+--- a/code/SIB/SIBImporter.cpp
++++ b/code/SIB/SIBImporter.cpp
+@@ -63,7 +63,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ # include <utf8/utf8.h>
+ #else
+ //# include "../contrib/ConvertUTF/ConvertUTF.h"
+-# include "../contrib/utf8cpp/source/utf8.h"
++# include <utf8.h>
+ #endif
+ #include <assimp/IOSystem.hpp>
+ #include <assimp/DefaultLogger.hpp>
+@@ -90,10 +90,10 @@ struct SIBChunk {
+ uint32_t Size;
+ } PACK_STRUCT;
+
+-enum {
+- POS,
+- NRM,
+- UV,
++enum {
++ POS,
++ NRM,
++ UV,
+ N
+ };
+
+diff --git a/code/X3D/FIReader.cpp b/code/X3D/FIReader.cpp
+index 9bb2c69..525a084 100644
+--- a/code/X3D/FIReader.cpp
++++ b/code/X3D/FIReader.cpp
+@@ -63,7 +63,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #ifdef ASSIMP_USE_HUNTER
+ # include <utf8/utf8.h>
+ #else
+-# include "../contrib/utf8cpp/source/utf8.h"
++# include <utf8.h>
+ #endif
+ #include <assimp/fast_atof.h>
+ #include <stack>
+diff --git a/contrib/clipper/clipper.hpp b/contrib/clipper/clipper.hpp
+index 7cdac6c..2728425 100644
+--- a/contrib/clipper/clipper.hpp
++++ b/contrib/clipper/clipper.hpp
+@@ -302,5 +302,3 @@ class clipperException : public std::exception
+ } //ClipperLib namespace
+
+ #endif //clipper_hpp
+-
+-
+diff --git a/contrib/zip/src/miniz.h b/contrib/zip/src/miniz.h
+index 2c27a94..8390dfd 100644
+--- a/contrib/zip/src/miniz.h
++++ b/contrib/zip/src/miniz.h
+@@ -5944,7 +5944,7 @@ mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name,
+ const char *pSrc_filename, const void *pComment,
+ mz_uint16 comment_size, mz_uint level_and_flags,
+ mz_uint32 ext_attributes) {
+- mz_uint uncomp_crc32 = MZ_CRC32_INIT, level, num_alignment_padding_bytes;
++ mz_uint uncomp_crc32 = MZ_CRC32_INIT, level=0, num_alignment_padding_bytes;
+ mz_uint16 method = 0, dos_time = 0, dos_date = 0;
+ time_t file_modified_time;
+ mz_uint64 local_dir_header_ofs, cur_archive_file_ofs, uncomp_size = 0,
+diff --git a/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp b/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp
+index 8d25aaa..e4bc306 100644
+--- a/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp
++++ b/samples/SimpleTexturedOpenGL/SimpleTexturedOpenGL/src/model_loading.cpp
+@@ -19,7 +19,7 @@
+ #include <GL/glu.h>
+
+ #define STB_IMAGE_IMPLEMENTATION
+-#include "contrib/stb_image/stb_image.h"
++#include <stb_image.h>
+
+ #include <fstream>
+
diff --git a/ports/assimp/cmake-policy.patch b/ports/assimp/cmake-policy.patch
deleted file mode 100644
index e8d681ed8..000000000
--- a/ports/assimp/cmake-policy.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/assimpTargets.cmake.in b/assimpTargets.cmake.in
-index ab1a8d2c..4b0729be 100644
---- a/assimpTargets.cmake.in
-+++ b/assimpTargets.cmake.in
-@@ -5,6 +5,8 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
- endif()
- cmake_policy(PUSH)
- cmake_policy(VERSION 2.6)
-+# Required for the evaluation of "if(@BUILD_SHARED_LIBS@)" below to function
-+cmake_policy(SET CMP0012 NEW)
- #----------------------------------------------------------------
- # Generated CMake target import file.
- #----------------------------------------------------------------
diff --git a/ports/assimp/config.patch b/ports/assimp/config.patch
new file mode 100644
index 000000000..7a7af9aaf
--- /dev/null
+++ b/ports/assimp/config.patch
@@ -0,0 +1,111 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4cb6927..d642832 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -352,7 +352,7 @@ IF (NOT TARGET uninstall)
+ ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
+ ENDIF()
+
+-IF(HUNTER_ENABLED)
++IF(HUNTER_ENABLED OR 1)
+ set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
+ set(INCLUDE_INSTALL_DIR "include")
+
+@@ -389,7 +389,7 @@ IF(HUNTER_ENABLED)
+ NAMESPACE "${NAMESPACE}"
+ DESTINATION "${CONFIG_INSTALL_DIR}"
+ )
+-ELSE(HUNTER_ENABLED)
++ELSE()
+ # cmake configuration files
+ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" @ONLY IMMEDIATE)
+ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake" @ONLY IMMEDIATE)
+@@ -412,7 +412,7 @@ ELSE(HUNTER_ENABLED)
+ "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake"
+ ${PACKAGE_TARGETS_FILE}
+ DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT})
+-ENDIF(HUNTER_ENABLED)
++ENDIF()
+
+ FIND_PACKAGE( DirectX )
+
+diff --git a/cmake/assimp-hunter-config.cmake.in b/cmake/assimp-hunter-config.cmake.in
+index 34762ac..ec1f554 100644
+--- a/cmake/assimp-hunter-config.cmake.in
++++ b/cmake/assimp-hunter-config.cmake.in
+@@ -1,14 +1,8 @@
+ @PACKAGE_INIT@
+
+ find_package(RapidJSON CONFIG REQUIRED)
+-find_package(ZLIB CONFIG REQUIRED)
+-find_package(utf8 CONFIG REQUIRED)
+-find_package(irrXML CONFIG REQUIRED)
++find_package(ZLIB REQUIRED)
+ find_package(minizip CONFIG REQUIRED)
+-find_package(openddlparser CONFIG REQUIRED)
+-find_package(poly2tri CONFIG REQUIRED)
+-find_package(polyclipping CONFIG REQUIRED)
+-find_package(zip CONFIG REQUIRED)
+
+ include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
+ check_required_components("@PROJECT_NAME@")
+diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
+index 8e14fcf..91a3a7b 100644
+--- a/code/CMakeLists.txt
++++ b/code/CMakeLists.txt
+@@ -676,7 +676,7 @@ SET( PostProcessing_SRCS
+ )
+ SOURCE_GROUP( PostProcessing FILES ${PostProcessing_SRCS})
+
+-SET( IrrXML_SRCS ${HEADER_PATH}/irrXMLWrapper.h )
++SET( IrrXML_SRCS ${PROJECT_SOURCE_DIR}/contrib/irrXML/irrXML.cpp ${HEADER_PATH}/irrXMLWrapper.h )
+ SOURCE_GROUP( IrrXML FILES ${IrrXML_SRCS})
+
+ ADD_ASSIMP_IMPORTER( Q3D
+@@ -1125,7 +1125,7 @@ IF(HUNTER_ENABLED)
+ zip::zip
+ )
+ ELSE(HUNTER_ENABLED)
+- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} minizip::minizip)
++ TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} minizip::minizip)
+ ENDIF(HUNTER_ENABLED)
+
+ if(ASSIMP_ANDROID_JNIIOSYSTEM)
+@@ -1222,7 +1222,7 @@ IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
+ TARGET_LINK_LIBRARIES(assimp ${RT_LIBRARY})
+ ENDIF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
+
+-IF(HUNTER_ENABLED)
++IF(HUNTER_ENABLED OR 1)
+ INSTALL( TARGETS assimp
+ EXPORT "${TARGETS_EXPORT_NAME}"
+ LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
+@@ -1231,14 +1231,14 @@ IF(HUNTER_ENABLED)
+ FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
+ COMPONENT ${LIBASSIMP_COMPONENT}
+ INCLUDES DESTINATION "include")
+-ELSE(HUNTER_ENABLED)
++ELSE()
+ INSTALL( TARGETS assimp
+ LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
+ RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
+ FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
+ COMPONENT ${LIBASSIMP_COMPONENT})
+-ENDIF(HUNTER_ENABLED)
++ENDIF()
+ INSTALL( FILES ${PUBLIC_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp COMPONENT assimp-dev)
+ INSTALL( FILES ${COMPILER_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp/Compiler COMPONENT assimp-dev)
+
+diff --git a/contrib/irrXML/CMakeLists.txt b/contrib/irrXML/CMakeLists.txt
+index 7f58af3..6d4b41e 100644
+--- a/contrib/irrXML/CMakeLists.txt
++++ b/contrib/irrXML/CMakeLists.txt
+@@ -21,6 +21,7 @@ ENDIF()
+ set(IRRXML_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "IrrXML_Include" )
+ set(IRRXML_LIBRARY "IrrXML" CACHE INTERNAL "IrrXML" )
+
++return()
+ install(TARGETS IrrXML
+ LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
diff --git a/ports/assimp/fix-static-build-error.patch b/ports/assimp/fix-static-build-error.patch
deleted file mode 100644
index 39531aed1..000000000
--- a/ports/assimp/fix-static-build-error.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index dcafb64..6c3d03e 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -253,7 +253,7 @@ ELSEIF(MSVC)
- IF(MSVC12)
- ADD_COMPILE_OPTIONS(/wd4351)
- ENDIF()
-- SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob2 /DEBUG:FULL /Zi")
-+# SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob2 /DEBUG:FULL /Zi")
- ELSEIF ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
- IF(NOT HUNTER_ENABLED)
- SET(CMAKE_CXX_FLAGS "-fPIC -std=c++11 ${CMAKE_CXX_FLAGS}")
diff --git a/ports/assimp/fix_minizip.patch b/ports/assimp/fix_minizip.patch
deleted file mode 100644
index a0207ebe6..000000000
--- a/ports/assimp/fix_minizip.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 6c3d03e..4cb6927 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -470,12 +470,12 @@ ENDIF(HUNTER_ENABLED)
-
- IF( NOT IOS )
- IF( NOT ASSIMP_BUILD_MINIZIP )
-- use_pkgconfig(UNZIP minizip)
-+ find_package(minizip CONFIG REQUIRED)
- ENDIF( NOT ASSIMP_BUILD_MINIZIP )
- ELSE ( NOT IOS )
- IF( NOT BUILD_SHARED_LIBS )
- IF( NOT ASSIMP_BUILD_MINIZIP )
-- use_pkgconfig(UNZIP minizip)
-+ find_package(minizip CONFIG REQUIRED)
- ENDIF( NOT ASSIMP_BUILD_MINIZIP )
- ENDIF ( NOT BUILD_SHARED_LIBS )
- ENDIF ( NOT IOS )
-diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
-index 55538d9..30568ff 100644
---- a/code/CMakeLists.txt
-+++ b/code/CMakeLists.txt
-@@ -1125,7 +1125,7 @@ IF(HUNTER_ENABLED)
- zip::zip
- )
- ELSE(HUNTER_ENABLED)
-- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} )
-+ TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} minizip::minizip)
- ENDIF(HUNTER_ENABLED)
-
- if(ASSIMP_ANDROID_JNIIOSYSTEM)
diff --git a/ports/assimp/portfile.cmake b/ports/assimp/portfile.cmake
index 3e81bbcff..9d4ddbca0 100644
--- a/ports/assimp/portfile.cmake
+++ b/ports/assimp/portfile.cmake
@@ -5,23 +5,28 @@ vcpkg_from_github(
SHA512 59b213428e2f7494cb5da423e6b2d51556318f948b00cea420090d74d4f5f0f8970d38dba70cd47b2ef35a1f57f9e15df8597411b6cd8732b233395080147c0f
HEAD_REF master
PATCHES
- uninitialized-variable.patch
- fix-static-build-error.patch
- cmake-policy.patch
- fix_minizip.patch
+ build_fixes.patch
)
file(REMOVE ${SOURCE_PATH}/cmake-modules/FindZLIB.cmake)
-file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/zlib ${SOURCE_PATH}/contrib/gtest ${SOURCE_PATH}/contrib/rapidjson)
+file(REMOVE ${SOURCE_PATH}/cmake-modules/FindIrrXML.cmake)
+#file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/clipper) # https://github.com/assimp/assimp/issues/788
+file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/poly2tri)
+file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/zlib)
+file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/gtest)
+file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/irrXML)
+file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/rapidjson)
+file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/stb_image)
+file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/zip)
+file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/unzip)
+file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/utf8cpp)
+#file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/Open3DGC) #TODO
+#file(REMOVE_RECURSE ${SOURCE_PATH}/contrib/openddlparser) #TODO
set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
-if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
- set(VCPKG_BUILD_SHARED_LIBS ON)
-else()
- set(VCPKG_BUILD_SHARED_LIBS OFF)
-endif()
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ASSIMP_BUILD_SHARED_LIBS)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
@@ -29,41 +34,29 @@ vcpkg_configure_cmake(
OPTIONS -DASSIMP_BUILD_TESTS=OFF
-DASSIMP_BUILD_ASSIMP_VIEW=OFF
-DASSIMP_BUILD_ZLIB=OFF
- -DASSIMP_BUILD_SHARED_LIBS=${VCPKG_BUILD_SHARED_LIBS}
+ -DASSIMP_BUILD_SHARED_LIBS=${ASSIMP_BUILD_SHARED_LIBS}
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF
-DASSIMP_INSTALL_PDB=OFF
- #-DSYSTEM_IRRXML=ON # Wait for the built-in irrxml to synchronize with port irrlich, add dependencies and enable this macro
+ -DSYSTEM_IRRXML=ON
+ -DIGNORE_GIT_HASH=ON
)
vcpkg_install_cmake()
-
-FILE(GLOB lib_cmake_directories RELATIVE "${CURRENT_PACKAGES_DIR}" "${CURRENT_PACKAGES_DIR}/lib/cmake/assimp-*")
-list(GET lib_cmake_directories 0 lib_cmake_directory)
-vcpkg_fixup_cmake_targets(CONFIG_PATH "${lib_cmake_directory}")
-
+vcpkg_fixup_cmake_targets()
vcpkg_copy_pdbs()
-file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share)
+file(READ ${CURRENT_PACKAGES_DIR}/share/assimp/AssimpConfig.cmake ASSIMP_CONFIG)
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/assimp/AssimpConfig.cmake "
+include(CMakeFindDependencyMacro)
+find_dependency(ZLIB)
+find_dependency(irrXML CONFIG)
+find_dependency(polyclipping CONFIG)
+find_dependency(minizip CONFIG)
+find_dependency(kubazip CONFIG)
+find_dependency(poly2tri CONFIG)
+${ASSIMP_CONFIG}")
+
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
-file(READ ${CURRENT_PACKAGES_DIR}/share/assimp/assimp-config.cmake ASSIMP_CONFIG)
-string(REPLACE "get_filename_component(ASSIMP_ROOT_DIR \"\${_PREFIX}\" PATH)"
- "set(ASSIMP_ROOT_DIR \${_PREFIX})" ASSIMP_CONFIG ${ASSIMP_CONFIG})
-
-if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
- if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
- string(REPLACE "set( ASSIMP_LIBRARIES \${ASSIMP_LIBRARIES})"
- "set( ASSIMP_LIBRARIES optimized \${ASSIMP_LIBRARY_DIRS}/\${ASSIMP_LIBRARIES}.lib debug \${ASSIMP_LIBRARY_DIRS}/../debug/lib/\${ASSIMP_LIBRARIES}d.lib)" ASSIMP_CONFIG ${ASSIMP_CONFIG})
- else()
- string(REPLACE "set( ASSIMP_LIBRARIES \${ASSIMP_LIBRARIES})"
- "set( ASSIMP_LIBRARIES optimized \${ASSIMP_LIBRARY_DIRS}/\${ASSIMP_LIBRARIES}.lib \${ASSIMP_LIBRARY_DIRS}/IrrXML.lib debug \${ASSIMP_LIBRARY_DIRS}/../debug/lib/\${ASSIMP_LIBRARIES}d.lib \${ASSIMP_LIBRARY_DIRS}/../debug/lib/IrrXMLd.lib)" ASSIMP_CONFIG ${ASSIMP_CONFIG})
- endif()
-else()
- string(REPLACE "set( ASSIMP_LIBRARIES \${ASSIMP_LIBRARIES})"
- "set( ASSIMP_LIBRARIES optimized \${ASSIMP_LIBRARY_DIRS}/lib\${ASSIMP_LIBRARIES}.a \${ASSIMP_LIBRARY_DIRS}/libIrrXML.a \${ASSIMP_LIBRARY_DIRS}/libz.a debug \${ASSIMP_LIBRARY_DIRS}/../debug/lib/lib\${ASSIMP_LIBRARIES}d.a \${ASSIMP_LIBRARY_DIRS}/../debug/lib/libIrrXMLd.a \${ASSIMP_LIBRARY_DIRS}/../debug/lib/libz.a)" ASSIMP_CONFIG ${ASSIMP_CONFIG})
-endif()
-
-file(WRITE ${CURRENT_PACKAGES_DIR}/share/assimp/assimp-config.cmake "${ASSIMP_CONFIG}")
-
-file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/assimp/uninitialized-variable.patch b/ports/assimp/uninitialized-variable.patch
deleted file mode 100644
index 74b2ead4d..000000000
--- a/ports/assimp/uninitialized-variable.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/contrib/zip/src/miniz.h b/contrib/zip/src/miniz.h
-index 2c27a94..8390dfd 100644
---- a/contrib/zip/src/miniz.h
-+++ b/contrib/zip/src/miniz.h
-@@ -5944,7 +5944,7 @@ mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name,
- const char *pSrc_filename, const void *pComment,
- mz_uint16 comment_size, mz_uint level_and_flags,
- mz_uint32 ext_attributes) {
-- mz_uint uncomp_crc32 = MZ_CRC32_INIT, level, num_alignment_padding_bytes;
-+ mz_uint uncomp_crc32 = MZ_CRC32_INIT, level=0, num_alignment_padding_bytes;
- mz_uint16 method = 0, dos_time = 0, dos_date = 0;
- time_t file_modified_time;
- mz_uint64 local_dir_header_ofs, cur_archive_file_ofs, uncomp_size = 0,
diff --git a/ports/irrxml/CMakeLists.txt b/ports/irrxml/CMakeLists.txt
new file mode 100644
index 000000000..71a2facf6
--- /dev/null
+++ b/ports/irrxml/CMakeLists.txt
@@ -0,0 +1,56 @@
+cmake_minimum_required(VERSION 3.2)
+project(irrXML)
+enable_language(CXX)
+
+set(INSTALL_BIN_DIR "bin" CACHE PATH "Path where exe and dll will be installed")
+set(INSTALL_LIB_DIR "lib" CACHE PATH "Path where lib will be installed")
+set(INSTALL_INCLUDE_DIR "include" CACHE PATH "Path where headers will be installed")
+set(INSTALL_CMAKE_DIR "share/irrxml" CACHE PATH "Path where cmake configs will be installed")
+
+# Make relative paths absolute (needed later on)
+set(RELATIVE_INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR})
+foreach(p LIB BIN INCLUDE CMAKE)
+ set(var INSTALL_${p}_DIR)
+ if(NOT IS_ABSOLUTE "${${var}}")
+ set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
+ endif()
+endforeach()
+
+set(SOURCES
+ ${CMAKE_CURRENT_LIST_DIR}/src/CXMLReaderImpl.h
+ ${CMAKE_CURRENT_LIST_DIR}/src/fast_atof.h
+ ${CMAKE_CURRENT_LIST_DIR}/src/heapsort.h
+ ${CMAKE_CURRENT_LIST_DIR}/src/irrArray.h
+ ${CMAKE_CURRENT_LIST_DIR}/src/irrString.h
+ ${CMAKE_CURRENT_LIST_DIR}/src/irrTypes.h
+ ${CMAKE_CURRENT_LIST_DIR}/src/irrXML.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/src/irrXML.h
+)
+
+add_library(${CMAKE_PROJECT_NAME} ${SOURCES})
+
+if(MSVC)
+ target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE _SCL_SECURE_NO_WARNINGS)
+ target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS)
+endif(MSVC)
+
+if (WIN32 AND BUILD_SHARED_LIBS)
+ set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
+endif()
+
+set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PUBLIC_HEADER src/irrXML.h)
+target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:${RELATIVE_INSTALL_INCLUDE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src>)
+
+install(TARGETS ${CMAKE_PROJECT_NAME} EXPORT ${CMAKE_PROJECT_NAME}Targets
+ RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
+ LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
+ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
+ PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}"
+ COMPONENT dev
+)
+
+install(EXPORT ${CMAKE_PROJECT_NAME}Targets
+ FILE ${CMAKE_PROJECT_NAME}Config.cmake
+ NAMESPACE ${CMAKE_PROJECT_NAME}::
+ DESTINATION "${INSTALL_CMAKE_DIR}"
+)
diff --git a/ports/irrxml/disable_asm_calls.patch b/ports/irrxml/disable_asm_calls.patch
new file mode 100644
index 000000000..5ce45e645
--- /dev/null
+++ b/ports/irrxml/disable_asm_calls.patch
@@ -0,0 +1,20 @@
+--- a/src/irrTypes.h
++++ b/src/irrTypes.h
+@@ -79,17 +79,13 @@ typedef unsigned short wchar_t;
+ #endif // microsoft compiler
+
+ //! define a break macro for debugging only in Win32 mode.
+-#if defined(WIN32) && defined(_MSC_VER) && defined(_DEBUG)
+-#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3}
+-#else
+ #define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
+-#endif
+
+ //! Defines a small statement to work around a microsoft compiler bug.
+ /** The microsft compiler 7.0 - 7.1 has a bug:
+ When you call unmanaged code that returns a bool type value of false from managed code,
+ the return value may appear as true. See
+ http://support.microsoft.com/default.aspx?kbid=823071 for details.
+ Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400*/
+ #if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400)
+ #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX __asm mov eax,100
diff --git a/ports/irrxml/portfile.cmake b/ports/irrxml/portfile.cmake
new file mode 100644
index 000000000..1c5595505
--- /dev/null
+++ b/ports/irrxml/portfile.cmake
@@ -0,0 +1,22 @@
+vcpkg_from_sourceforge(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO irrlicht/irrXML%20SDK
+ REF 1.2
+ FILENAME irrxml-1.2.zip
+ SHA512 b6a7f76305c6d1e74a66bc182bd260428b9aa0b1db444f79de56095a7d39e320429756329202b44d3159f6b4d9ff13b7ebb6b88ca3d087f09c3a4a3a0ce08995
+ PATCHES
+ disable_asm_calls.patch
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets()
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+file(INSTALL ${SOURCE_PATH}/readme.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/irrxml/vcpkg.json b/ports/irrxml/vcpkg.json
new file mode 100644
index 000000000..3d7ad0332
--- /dev/null
+++ b/ports/irrxml/vcpkg.json
@@ -0,0 +1,6 @@
+{
+ "name": "irrxml",
+ "version-string": "1.2",
+ "description": "XML library from IRRLICHT Enging",
+ "homepage": "http://irrlicht.sourceforge.net"
+}
diff --git a/ports/kubazip/CONTROL b/ports/kubazip/CONTROL
new file mode 100644
index 000000000..d19677ff4
--- /dev/null
+++ b/ports/kubazip/CONTROL
@@ -0,0 +1,4 @@
+Source: kubazip
+Version: 0.1.19
+Homepage: https://github.com/kuba--/zip
+Description: A portable, simple zip library written in C
diff --git a/ports/kubazip/fix_targets.patch b/ports/kubazip/fix_targets.patch
new file mode 100644
index 000000000..e5ffb8608
--- /dev/null
+++ b/ports/kubazip/fix_targets.patch
@@ -0,0 +1,52 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 55dfc77..f0182f9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 3.4)
+
+-project(zip
++project(kubazip
+ LANGUAGES C
+ VERSION "0.1.19")
+ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
+@@ -15,7 +15,7 @@ if (MSVC)
+ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
+ "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
+ "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -Werror -pedantic")
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic")
+ endif (MSVC)
+
+ # zip
+@@ -37,7 +37,7 @@ endif()
+
+ target_include_directories(${PROJECT_NAME} PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
+- $<INSTALL_INTERFACE:include>
++ $<INSTALL_INTERFACE:include/${PROJECT_NAME}>
+ )
+
+ # test
+@@ -52,7 +52,7 @@ endif()
+ # Installation (https://github.com/forexample/package-example) {
+
+ set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
+-set(INCLUDE_INSTALL_DIR "include")
++set(INCLUDE_INSTALL_DIR "include/${PROJECT_NAME}")
+
+ set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 04c2123..002cf5a 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.4)
+ set(test_out test.out)
+
+ add_executable(${test_out} test.c)
+-target_link_libraries(${test_out} zip)
++target_link_libraries(${test_out} kubazip)
+
+ add_test(NAME ${test_out} COMMAND ${test_out})
+
diff --git a/ports/kubazip/portfile.cmake b/ports/kubazip/portfile.cmake
new file mode 100644
index 000000000..ba2f488e0
--- /dev/null
+++ b/ports/kubazip/portfile.cmake
@@ -0,0 +1,22 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO kuba--/zip
+ REF 96924c94dabe362bbb1588aa70209e638e6fb35c
+ SHA512 bc3e9ecf39d54321314d09209f356a2491893591a016b1619abcdea8c1fb1fa8ba1f9858f4e758641df083ed237a2ec9f0af13e0f1d802502257644168ae8907
+ HEAD_REF master
+ PATCHES
+ fix_targets.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/kubazip)
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+file(INSTALL ${SOURCE_PATH}/UNLICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/poly2tri/CMakeLists.txt b/ports/poly2tri/CMakeLists.txt
new file mode 100644
index 000000000..d3878712a
--- /dev/null
+++ b/ports/poly2tri/CMakeLists.txt
@@ -0,0 +1,57 @@
+cmake_minimum_required(VERSION 3.0)
+
+project(poly2tri LANGUAGES C CXX)
+
+set(INSTALL_BIN_DIR "bin" CACHE PATH "Path where exe and dll will be installed")
+set(INSTALL_LIB_DIR "lib" CACHE PATH "Path where lib will be installed")
+set(INSTALL_INCLUDE_DIR "include/${PROJECT_NAME}" CACHE PATH "Path where headers will be installed")
+set(INSTALL_CMAKE_DIR "share/${PROJECT_NAME}" CACHE PATH "Path where cmake configs will be installed")
+
+set(${PROJECT_NAME}_HEADERS
+ "poly2tri/poly2tri.h"
+)
+
+set(${PROJECT_NAME}_COMMON_HEADERS
+ "poly2tri/common/shapes.h"
+ "poly2tri/common/utils.h"
+)
+
+set(${PROJECT_NAME}_SWEEP_HEADERS
+ "poly2tri/sweep/advancing_front.h"
+ "poly2tri/sweep/cdt.h"
+ "poly2tri/sweep/sweep.h"
+ "poly2tri/sweep/sweep_context.h"
+)
+
+set(${PROJECT_NAME}_SOURCES
+ "poly2tri/common/shapes.cc"
+ "poly2tri/sweep/advancing_front.cc"
+ "poly2tri/sweep/cdt.cc"
+ "poly2tri/sweep/sweep.cc"
+ "poly2tri/sweep/sweep_context.cc"
+)
+
+add_library(${PROJECT_NAME} "${${PROJECT_NAME}_HEADERS}" "${${PROJECT_NAME}_COMMON_HEADERS}" "${${PROJECT_NAME}_SWEEP_HEADERS}" "${${PROJECT_NAME}_SOURCES}")
+set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${${PROJECT_NAME}_HEADERS}")
+target_include_directories(${PROJECT_NAME} PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/poly2tri>
+ $<INSTALL_INTERFACE:include>
+ $<INSTALL_INTERFACE:include/${PROJECT_NAME}>
+)
+
+install(FILES ${${PROJECT_NAME}_COMMON_HEADERS} DESTINATION "${INSTALL_INCLUDE_DIR}/common")
+install(FILES ${${PROJECT_NAME}_SWEEP_HEADERS} DESTINATION "${INSTALL_INCLUDE_DIR}/sweep")
+
+install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets
+ RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
+ LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
+ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
+ PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}"
+ COMPONENT dev
+)
+
+install (EXPORT ${PROJECT_NAME}Targets
+ FILE ${PROJECT_NAME}Config.cmake
+ NAMESPACE ${PROJECT_NAME}::
+ DESTINATION "${INSTALL_CMAKE_DIR}"
+)
diff --git a/ports/poly2tri/CONTROL b/ports/poly2tri/CONTROL
new file mode 100644
index 000000000..21ed149e3
--- /dev/null
+++ b/ports/poly2tri/CONTROL
@@ -0,0 +1,5 @@
+Source: poly2tri
+Version: 2020-07-21
+Homepage: https://github.com/greenm01/poly2tri
+Description: The Clipper library performs clipping and offsetting for both lines and polygons. All four boolean clipping operations are supported - intersection, union, difference and exclusive-or. Polygons can be of any shape including self-intersecting polygons.
+Supports: !uwp
diff --git a/ports/poly2tri/portfile.cmake b/ports/poly2tri/portfile.cmake
new file mode 100644
index 000000000..278e3d8ee
--- /dev/null
+++ b/ports/poly2tri/portfile.cmake
@@ -0,0 +1,26 @@
+vcpkg_fail_port_install(ON_TARGET "uwp")
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO greenm01/poly2tri
+ REF 88de49021b6d9bef6faa1bc94ceb3fbd85c3c204
+ SHA512 fa256bcf923ad59f42205edf5a7e07cac6cbd9a37cefb9a0961a2e06aea7fa8ffd09d4e26154c0028601c12804483842cb935d9f602385f5f203c9628382c4fb
+ HEAD_REF master
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/polyclipping/CONTROL b/ports/polyclipping/CONTROL
index 198090cc6..819697deb 100644
--- a/ports/polyclipping/CONTROL
+++ b/ports/polyclipping/CONTROL
@@ -1,4 +1,5 @@
Source: polyclipping
-Version: 6.4.2-4
+Version: 6.4.2
+Port-Version: 5
Homepage: https://sourceforge.net/projects/polyclipping/
Description: The Clipper library performs clipping and offsetting for both lines and polygons. All four boolean clipping operations are supported - intersection, union, difference and exclusive-or. Polygons can be of any shape including self-intersecting polygons.
diff --git a/ports/polyclipping/FindCLIPPER.cmake b/ports/polyclipping/FindCLIPPER.cmake
new file mode 100644
index 000000000..5a1fcab34
--- /dev/null
+++ b/ports/polyclipping/FindCLIPPER.cmake
@@ -0,0 +1,45 @@
+# Distributed under the OSI-approved BSD 3-Clause License.
+
+#.rst:
+# FindCLIPPER
+# --------
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module will set the following variables in your project::
+#
+# ``CLIPPER_FOUND``
+# True if CLIPPER found on the local system
+#
+# ``CLIPPER_INCLUDE_DIRS``
+# Location of CLIPPER header files.
+#
+# ``CLIPPER_LIBRARIES``
+# The clipper libraries.
+#
+
+include(FindPackageHandleStandardArgs)
+include(SelectLibraryConfigurations)
+
+if(NOT CLIPPER_INCLUDE_DIR)
+ find_path(CLIPPER_INCLUDE_DIR clipper.hpp
+ PATH_SUFFIXES polyclipping)
+endif()
+
+if(NOT CLIPPER_LIBRARY)
+ find_library(CLIPPER_LIBRARY_RELEASE NAMES polyclipping PATHS "${CMAKE_CURRENT_LIST_DIR}/../../lib" NO_DEFAULT_PATH)
+ find_library(CLIPPER_LIBRARY_DEBUG NAMES polyclipping PATHS "${CMAKE_CURRENT_LIST_DIR}/../../debug/lib" NO_DEFAULT_PATH)
+ select_library_configurations(CLIPPER)
+endif()
+
+mark_as_advanced(CLIPPER_LIBRARY CLIPPER_INCLUDE_DIR)
+
+find_package_handle_standard_args(CLIPPER
+ REQUIRED_VARS CLIPPER_LIBRARY CLIPPER_INCLUDE_DIR
+)
+
+if(CLIPPER_FOUND)
+ set(CLIPPER_LIBRARIES ${CLIPPER_LIBRARY})
+ set(CLIPPER_INCLUDE_DIRS ${CLIPPER_INCLUDE_DIR})
+endif()
diff --git a/ports/polyclipping/fix_targets.patch b/ports/polyclipping/fix_targets.patch
new file mode 100644
index 000000000..2435fe046
--- /dev/null
+++ b/ports/polyclipping/fix_targets.patch
@@ -0,0 +1,16 @@
+diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
+index f0ed7e8..a5ed444 100644
+--- a/cpp/CMakeLists.txt
++++ b/cpp/CMakeLists.txt
+@@ -19,3 +19,11 @@ INSTALL (TARGETS polyclipping LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+ INSTALL (FILES "${PCFILE}" DESTINATION "${CMAKE_INSTALL_PKGCONFIGDIR}")
+
+ SET_TARGET_PROPERTIES(polyclipping PROPERTIES VERSION 22.0.0 SOVERSION 22 )
++
++install(TARGETS polyclipping EXPORT polyclippingConfig)
++
++install(
++ EXPORT polyclippingConfig
++ NAMESPACE polyclipping::
++ DESTINATION share/polyclipping
++)
diff --git a/ports/polyclipping/portfile.cmake b/ports/polyclipping/portfile.cmake
index 1626d81ba..8eb73a635 100644
--- a/ports/polyclipping/portfile.cmake
+++ b/ports/polyclipping/portfile.cmake
@@ -6,6 +6,8 @@ vcpkg_from_sourceforge(
FILENAME "clipper_ver6.4.2.zip"
NO_REMOVE_ONE_LEVEL
SHA512 ffc88818c44a38aa278d5010db6cfd505796f39664919f1e48c7fa9267563f62135868993e88f7246dcd688241d1172878e4a008a390648acb99738452e3e5dd
+ PATCHES
+ fix_targets.patch
)
vcpkg_configure_cmake(
@@ -13,9 +15,13 @@ vcpkg_configure_cmake(
PREFER_NINJA
)
+
vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/FindCLIPPER.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/clipper)
+file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/clipper)
file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/polyclipping/vcpkg-cmake-wrapper.cmake b/ports/polyclipping/vcpkg-cmake-wrapper.cmake
new file mode 100644
index 000000000..bd8934208
--- /dev/null
+++ b/ports/polyclipping/vcpkg-cmake-wrapper.cmake
@@ -0,0 +1,10 @@
+list(REMOVE_ITEM ARGS "NO_MODULE")
+list(REMOVE_ITEM ARGS "CONFIG")
+list(REMOVE_ITEM ARGS "MODULE")
+
+set(clipper_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
+
+_find_package(${ARGS})
+
+set(CMAKE_MODULE_PATH ${clipper_PREV_MODULE_PATH})