Skip to content

Commit

Permalink
[xatlas] Create a new port (#126)
Browse files Browse the repository at this point in the history
* [xatlas] create a new port

* [xatlas] update version-date

* [xatlas] update baseline

* ci: test xatlas
  • Loading branch information
luncliff authored Nov 16, 2023
1 parent 02b94f3 commit b6ae526
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 0 deletions.
34 changes: 34 additions & 0 deletions ports/xatlas/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
)
23 changes: 23 additions & 0 deletions ports/xatlas/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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")
16 changes: 16 additions & 0 deletions ports/xatlas/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
1 change: 1 addition & 0 deletions test/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"name": "vcpkg-cmake",
"host": true
},
"xatlas",
"zlib-ng"
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions versions/x-/xatlas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "e646b0e7caaf2a87b82e94132fca858f1ae73272",
"version-date": "2023-11-07",
"port-version": 0
}
]
}

0 comments on commit b6ae526

Please sign in to comment.