aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>2020-01-02 13:42:04 -0800
committerdan-shaw <51385773+dan-shaw@users.noreply.github.com>2020-01-02 13:42:04 -0800
commitf13fb1c96b35998ec0917c81e7c9d564ceae0f6d (patch)
tree3c560f14625456b699b28f375fa10b6f6e7a4617
parent6403c56e7ce5546240532c4afdb76f0d2c725cb5 (diff)
downloadvcpkg-f13fb1c96b35998ec0917c81e7c9d564ceae0f6d.tar.gz
vcpkg-f13fb1c96b35998ec0917c81e7c9d564ceae0f6d.zip
[ptext] Fix library cannot be found by find_package() (#9455)
* [ptext] Fix library cannot be found by find_package() * Update copyright
-rw-r--r--ports/ptex/CONTROL2
-rw-r--r--ports/ptex/fix-config.cmake.patch18
-rw-r--r--ports/ptex/portfile.cmake14
3 files changed, 25 insertions, 9 deletions
diff --git a/ports/ptex/CONTROL b/ports/ptex/CONTROL
index 069f2e628..823988f85 100644
--- a/ports/ptex/CONTROL
+++ b/ports/ptex/CONTROL
@@ -1,5 +1,5 @@
Source: ptex
-Version: 2.3.2
+Version: 2.3.2-1
Homepage: https://github.com/wdas/ptex
Description: Per-Face Texture Mapping for Production Rendering.
Build-Depends: zlib
diff --git a/ports/ptex/fix-config.cmake.patch b/ports/ptex/fix-config.cmake.patch
new file mode 100644
index 000000000..d635d4e05
--- /dev/null
+++ b/ports/ptex/fix-config.cmake.patch
@@ -0,0 +1,18 @@
+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@)
diff --git a/ports/ptex/portfile.cmake b/ports/ptex/portfile.cmake
index 94a626a34..933364097 100644
--- a/ports/ptex/portfile.cmake
+++ b/ports/ptex/portfile.cmake
@@ -1,8 +1,4 @@
-include(vcpkg_common_functions)
-
-if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
- message(FATAL_ERROR "UWP build not supported")
-endif()
+vcpkg_fail_port_install(ON_TARGET "uwp")
set(PTEX_VER 2.3.2)
@@ -12,7 +8,9 @@ vcpkg_from_github(
REF 1b8bc985a71143317ae9e4969fa08e164da7c2e5
SHA512 37f2df9ec195f3d69d9526d0dea6a93ef49d69287bfae6ccd9671477491502ea760ed14e3b206b4f488831ab728dc749847b7d176c9b8439fb58b0a0466fe6c5
HEAD_REF master
- PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-build.patch
+ PATCHES
+ fix-build.patch
+ fix-config.cmake.patch
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
@@ -47,5 +45,5 @@ foreach(HEADER PtexHalf.h Ptexture.h)
endforeach()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
-file(COPY ${SOURCE_PATH}/src/doc/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/ptex)
-file(RENAME ${CURRENT_PACKAGES_DIR}/share/ptex/license.txt ${CURRENT_PACKAGES_DIR}/share/ptex/copyright)
+# Handle copyright
+file(INSTALL ${SOURCE_PATH}/src/doc/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)