[ptex] Update to 2.4.2 (#36842)

<!-- If your PR fixes issues, please note that here by adding "Fixes
#NNNNNN." for each fixed issue on separate lines. -->
Fixes #36806 
Usage passed on `x64-windows`.
<!-- If you are still working on the PR, open it as a Draft:
https://github.blog/2019-02-14-introducing-draft-pull-requests/. -->



- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [x] SHA512s are updated for each updated download.
- [ ] ~~The "supports" clause reflects platforms that may be fixed by
this new version.~~
- [ ] Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.
- [x] Any patches that are no longer applied are deleted from the port's
directory.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.



<!-- If this PR adds a new port, please uncomment and fill out this
checklist:

- [ ] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [ ] The name of the port matches an existing name for this component
on https://repology.org/ if possible, and/or is strongly associated with
that component on search engines.
- [ ] Optional dependencies are resolved in exactly one way. For
example, if the component is built with CMake, all `find_package` calls
are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or
disabled with
[CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html).
- [ ] The versioning scheme in `vcpkg.json` matches what upstream says.
- [ ] The license declaration in `vcpkg.json` matches what upstream
says.
- [ ] The installed as the "copyright" file matches what upstream says.
- [ ] The source code of the component installed comes from an
authoritative source.
- [ ] The generated "usage text" is accurate. See
[adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md)
for context.
- [ ] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [ ] Only one version is in the new port's versions file.
- [ ] Only one version is added to each modified port's versions file.

END OF NEW PORT CHECKLIST (delete this line) -->

---------

Co-authored-by: Lily Wang <v-lilywang@microsoft.com>
This commit is contained in:
Lily Wang 2024-02-21 09:39:38 -08:00 committed by GitHub
parent 69bbfacdb7
commit be3b12a118
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 38 additions and 113 deletions

View File

@ -1,99 +1,40 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c708153..0e004da 100644
index 2f8c3af..d4d4425 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,10 +60,11 @@ include(GNUInstallDirs)
@@ -27,7 +27,9 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
include(GNUInstallDirs)
include(CTest)
include(FindThreads)
+find_package(ZLIB REQUIRED)
+if (0)
# Use pkg-config to create a PkgConfig::Ptex_ZLIB imported target
find_package(PkgConfig REQUIRED)
pkg_checK_modules(Ptex_ZLIB REQUIRED zlib IMPORTED_TARGET)
-
+if(0)
enable_testing()
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
@@ -77,6 +78,7 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
endif ()
endif ()
+endif()
if (NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
@@ -99,7 +101,9 @@ endif ()
# Setup platform-specific threading flags.
find_package(Threads REQUIRED)
@@ -112,7 +114,9 @@ endif ()
include_directories(src/ptex)
add_subdirectory(src/ptex)
+if (0)
+if(0)
add_subdirectory(src/utils)
add_subdirectory(src/tests)
add_subdirectory(src/doc)
+endif()
add_subdirectory(src/build)
diff --git a/src/ptex/CMakeLists.txt b/src/ptex/CMakeLists.txt
index ba3a3cc..1619ff1 100644
index 4dfe372..4572dd5 100644
--- a/src/ptex/CMakeLists.txt
+++ b/src/ptex/CMakeLists.txt
@@ -1,6 +1,8 @@
-if (WIN32)
- add_definitions(/DPTEX_EXPORTS)
-endif (WIN32)
+if (BUILD_SHARED_LIBS)
+ add_definitions(-DPTEX_EXPORTS)
+else ()
+ add_definitions(-DPTEX_STATIC)
+endif ()
configure_file(PtexVersion.h.in
${CMAKE_CURRENT_SOURCE_DIR}/PtexVersion.h @ONLY)
@@ -18,29 +20,35 @@ set(SRCS
PtexWriter.cpp)
if(PTEX_BUILD_STATIC_LIBS)
- add_library(Ptex_static STATIC ${SRCS})
- set_target_properties(Ptex_static PROPERTIES OUTPUT_NAME Ptex)
- target_include_directories(Ptex_static
+ add_library(Ptex STATIC ${SRCS})
+ target_include_directories(Ptex
PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR})
- target_link_libraries(Ptex_static
- PUBLIC ${CMAKE_THREAD_LIBS_INIT} PkgConfig::Ptex_ZLIB)
- install(TARGETS Ptex_static EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ target_link_libraries(Ptex
+ PUBLIC ${CMAKE_THREAD_LIBS_INIT} ZLIB::ZLIB)
+ install(TARGETS Ptex EXPORT Ptex
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ )
endif()
if(PTEX_BUILD_SHARED_LIBS)
- add_library(Ptex_dynamic SHARED ${SRCS})
- set_target_properties(Ptex_dynamic PROPERTIES OUTPUT_NAME Ptex)
- target_include_directories(Ptex_dynamic
+ add_library(Ptex SHARED ${SRCS})
+ target_include_directories(Ptex
PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR})
- target_link_libraries(Ptex_dynamic
- PUBLIC ${CMAKE_THREAD_LIBS_INIT} PkgConfig::Ptex_ZLIB)
@@ -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})
+ target_link_libraries(Ptex
+ PUBLIC ${CMAKE_THREAD_LIBS_INIT} ZLIB::ZLIB)
+ install(TARGETS Ptex EXPORT Ptex
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ )
+ install(TARGETS Ptex_dynamic EXPORT Ptex
+ RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
endif()
install(FILES

View File

@ -1,18 +0,0 @@
diff --git a/src/build/ptex-config.cmake b/src/build/ptex-config.cmake
index f95df9e..2d3f58f 100644
--- a/src/build/ptex-config.cmake
+++ b/src/build/ptex-config.cmake
@@ -1,11 +1,11 @@
@PACKAGE_INIT@
+include(CMakeFindDependencyMacro)
include("${CMAKE_CURRENT_LIST_DIR}/ptex-version.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/ptex-exports.cmake")
# Provide PkgConfig::ZLIB to downstream dependents
-find_package(PkgConfig REQUIRED)
-pkg_checK_modules(Ptex_ZLIB REQUIRED zlib IMPORTED_TARGET)
+find_dependency(ZLIB REQUIRED)
set_and_check(Ptex_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@)
set_and_check(Ptex_LIBRARY_DIRS @PACKAGE_CMAKE_INSTALL_LIBDIR@)

View File

@ -1,29 +1,21 @@
set(PTEX_VER 2.3.2)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wdas/ptex
REF 1b8bc985a71143317ae9e4969fa08e164da7c2e5
SHA512 37f2df9ec195f3d69d9526d0dea6a93ef49d69287bfae6ccd9671477491502ea760ed14e3b206b4f488831ab728dc749847b7d176c9b8439fb58b0a0466fe6c5
REF "v${VERSION}"
SHA512 3b9607b7803e7c857bb00a6d4d8bbe108810c622a3593fb5d655183f3e6689f274ee5e79bcaab6928de38daf05cf25eb56125f39477f134131a8ad45071551b3
HEAD_REF master
PATCHES
fix-build.patch
fix-config.cmake.patch
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(BUILD_SHARED_LIB ON)
set(BUILD_STATIC_LIB OFF)
else()
set(BUILD_SHARED_LIB OFF)
set(BUILD_STATIC_LIB ON)
endif()
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${PTEX_VER}
"-DPTEX_VER=v${VERSION}"
-DPTEX_BUILD_SHARED_LIBS=${BUILD_SHARED_LIB}
-DPTEX_BUILD_STATIC_LIBS=${BUILD_STATIC_LIB}
)
@ -44,4 +36,5 @@ endforeach()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
file(INSTALL "${SOURCE_PATH}/src/doc/License.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

4
ports/ptex/usage Normal file
View File

@ -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>)

View File

@ -1,9 +1,9 @@
{
"name": "ptex",
"version": "2.3.2",
"port-version": 4,
"version": "2.4.2",
"description": "Per-Face Texture Mapping for Production Rendering.",
"homepage": "https://github.com/wdas/ptex",
"license": "BSD-3-Clause",
"supports": "!uwp",
"dependencies": [
{

View File

@ -6909,8 +6909,8 @@
"port-version": 1
},
"ptex": {
"baseline": "2.3.2",
"port-version": 4
"baseline": "2.4.2",
"port-version": 0
},
"pthread": {
"baseline": "3.0.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "64ba10b1e0174e06bcb2821e395d411641d1611e",
"version": "2.4.2",
"port-version": 0
},
{
"git-tree": "3f04f712745e5fb558f79324199b3fe8c1a00b84",
"version": "2.3.2",