From b6ae52647fe059827cc9a4bafc33af9643d95d77 Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Fri, 17 Nov 2023 03:38:41 +0900 Subject: [PATCH] [xatlas] Create a new port (#126) * [xatlas] create a new port * [xatlas] update version-date * [xatlas] update baseline * ci: test xatlas --- ports/xatlas/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++ ports/xatlas/portfile.cmake | 23 +++++++++++++++++++++++ ports/xatlas/vcpkg.json | 16 ++++++++++++++++ test/vcpkg.json | 1 + versions/baseline.json | 4 ++++ versions/x-/xatlas.json | 9 +++++++++ 6 files changed, 87 insertions(+) create mode 100644 ports/xatlas/CMakeLists.txt create mode 100644 ports/xatlas/portfile.cmake create mode 100644 ports/xatlas/vcpkg.json create mode 100644 versions/x-/xatlas.json diff --git a/ports/xatlas/CMakeLists.txt b/ports/xatlas/CMakeLists.txt new file mode 100644 index 00000000..b2ea9150 --- /dev/null +++ b/ports/xatlas/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.13) +project(xatlas LANGUAGES CXX) +include(GNUInstallDirs) + +set(CMAKE_CXX_STANDARD 11) + +list(APPEND headers xatlas/xatlas.h xatlas/xatlas_c.h) + +add_library(xatlas + ${headers} + xatlas/xatlas.cpp +) + +set_target_properties(xatlas +PROPERTIES + PUBLIC_HEADER "${headers}" +) + +if(BUILD_SHARED_LIBS) + target_compile_definitions(xatlas PRIVATE XATLAS_EXPORT_API=1) +else() + target_compile_definitions(xatlas PRIVATE XATLAS_EXPORT_API=0) +endif() + +install(TARGETS xatlas + EXPORT xatlas-config # minor trick to support `find_package(xatlas)` + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) +install(EXPORT xatlas-config + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xatlas # share/xatlas +) diff --git a/ports/xatlas/portfile.cmake b/ports/xatlas/portfile.cmake new file mode 100644 index 00000000..816011a7 --- /dev/null +++ b/ports/xatlas/portfile.cmake @@ -0,0 +1,23 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jpcy/xatlas + REF f700c7790aaa030e794b52ba7791a05c085faf0c + SHA512 1f7afcc9056ab636abef017033aaf63d219cdec95e871beade2c694f8e8b4a58563cf506c5afb6d0d5536233f791e11adbcf3f6f26548105b31d381289892dea + HEAD_REF master +) +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}/source") + +vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}/source") +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH share/${PORT}) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" +) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/xatlas/vcpkg.json b/ports/xatlas/vcpkg.json new file mode 100644 index 00000000..b377ebd1 --- /dev/null +++ b/ports/xatlas/vcpkg.json @@ -0,0 +1,16 @@ +{ + "name": "xatlas", + "version-date": "2023-11-07", + "description": "Mesh parameterization / UV unwrapping library", + "homepage": "https://github.com/jpcy/xatlas", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/test/vcpkg.json b/test/vcpkg.json index cfca4978..bd1cabe3 100644 --- a/test/vcpkg.json +++ b/test/vcpkg.json @@ -31,6 +31,7 @@ "name": "vcpkg-cmake", "host": true }, + "xatlas", "zlib-ng" ] } diff --git a/versions/baseline.json b/versions/baseline.json index 77fca43f..32e12ee8 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -124,6 +124,10 @@ "baseline": "2021-11-13", "port-version": 0 }, + "xatlas": { + "baseline": "2023-11-07", + "port-version": 0 + }, "xnnpack": { "baseline": "2023-04-13", "port-version": 0 diff --git a/versions/x-/xatlas.json b/versions/x-/xatlas.json new file mode 100644 index 00000000..eee259d0 --- /dev/null +++ b/versions/x-/xatlas.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "e646b0e7caaf2a87b82e94132fca858f1ae73272", + "version-date": "2023-11-07", + "port-version": 0 + } + ] +}