aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/ptex
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/ptex
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/ptex')
-rw-r--r--vcpkg/ports/ptex/fix-build.patch42
-rw-r--r--vcpkg/ports/ptex/portfile.cmake49
-rw-r--r--vcpkg/ports/ptex/usage4
-rw-r--r--vcpkg/ports/ptex/vcpkg.json20
4 files changed, 115 insertions, 0 deletions
diff --git a/vcpkg/ports/ptex/fix-build.patch b/vcpkg/ports/ptex/fix-build.patch
new file mode 100644
index 0000000..e92842d
--- /dev/null
+++ b/vcpkg/ports/ptex/fix-build.patch
@@ -0,0 +1,42 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 78f6531..b7ea30b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -28,7 +28,9 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ include(GNUInstallDirs)
+
+ include(CTest)
++if(0)
+ enable_testing()
++endif()
+
+ # Setup platform-specific threading flags.
+ find_package(Threads REQUIRED)
+@@ -113,9 +115,11 @@ endif ()
+ include_directories(src/ptex)
+
+ add_subdirectory(src/ptex)
++if(0)
+ add_subdirectory(src/utils)
+ add_subdirectory(src/tests)
+ if (PTEX_BUILD_DOCS)
+ add_subdirectory(src/doc)
+ endif ()
++endif ()
+ add_subdirectory(src/build)
+diff --git a/src/ptex/CMakeLists.txt b/src/ptex/CMakeLists.txt
+index 4dfe372..4572dd5 100644
+--- a/src/ptex/CMakeLists.txt
++++ b/src/ptex/CMakeLists.txt
+@@ -40,7 +40,10 @@ if(PTEX_BUILD_SHARED_LIBS)
+ target_compile_definitions(Ptex_dynamic PRIVATE PTEX_EXPORTS)
+ target_link_libraries(Ptex_dynamic
+ PUBLIC Threads::Threads ZLIB::ZLIB)
+- install(TARGETS Ptex_dynamic EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR})
++ install(TARGETS Ptex_dynamic EXPORT Ptex
++ RUNTIME DESTINATION ${BIN_INSTALL_DIR}
++ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
++ ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
+ endif()
+
+ install(FILES
diff --git a/vcpkg/ports/ptex/portfile.cmake b/vcpkg/ports/ptex/portfile.cmake
new file mode 100644
index 0000000..4ed1d3e
--- /dev/null
+++ b/vcpkg/ports/ptex/portfile.cmake
@@ -0,0 +1,49 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO wdas/ptex
+ REF "v${VERSION}"
+ SHA512 34fcaf1c4fe27cb4e66d66bb729137ef17ffeea2bc2d849f2f5f543b19acc250f425633142320ce797c2a086e04bc3e0870c94928ad45d94e34faee71af36890
+ HEAD_REF master
+ PATCHES
+ fix-build.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIB)
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIB)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ DISABLE_PARALLEL_CONFIGURE
+ OPTIONS
+ "-DPTEX_VER=v${VERSION}"
+ -DPTEX_BUILD_SHARED_LIBS=${BUILD_SHARED_LIB}
+ -DPTEX_BUILD_STATIC_LIBS=${BUILD_STATIC_LIB}
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Ptex )
+file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
+file(RENAME "${CURRENT_PACKAGES_DIR}/share/pkgconfig/ptex.pc" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/ptex.pc")
+if(NOT VCPKG_BUILD_TYPE)
+ file(COPY "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/ptex.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/")
+endif()
+vcpkg_fixup_pkgconfig()
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/pkgconfig")
+
+vcpkg_copy_pdbs()
+
+foreach(HEADER PtexHalf.h Ptexture.h)
+ file(READ "${CURRENT_PACKAGES_DIR}/include/${HEADER}" PTEX_HEADER)
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ string(REPLACE "ifndef PTEX_STATIC" "if 1" PTEX_HEADER "${PTEX_HEADER}")
+ else()
+ string(REPLACE "ifndef PTEX_STATIC" "if 0" PTEX_HEADER "${PTEX_HEADER}")
+ endif()
+ file(WRITE "${CURRENT_PACKAGES_DIR}/include/${HEADER}" "${PTEX_HEADER}")
+endforeach()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/ptex/usage b/vcpkg/ports/ptex/usage
new file mode 100644
index 0000000..82fd687
--- /dev/null
+++ b/vcpkg/ports/ptex/usage
@@ -0,0 +1,4 @@
+Ptex provides CMake targets:
+
+ find_package(ptex CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:Ptex::Ptex_dynamic>,Ptex::Ptex_dynamic,Ptex::Ptex_static>)
diff --git a/vcpkg/ports/ptex/vcpkg.json b/vcpkg/ports/ptex/vcpkg.json
new file mode 100644
index 0000000..682b7c1
--- /dev/null
+++ b/vcpkg/ports/ptex/vcpkg.json
@@ -0,0 +1,20 @@
+{
+ "name": "ptex",
+ "version": "2.4.3",
+ "port-version": 1,
+ "description": "Per-Face Texture Mapping for Production Rendering.",
+ "homepage": "https://github.com/wdas/ptex",
+ "license": "BSD-3-Clause",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ },
+ "zlib"
+ ]
+}