early-access version 2853
This commit is contained in:
99
externals/vcpkg/ports/ptex/fix-build.patch
vendored
Executable file
99
externals/vcpkg/ports/ptex/fix-build.patch
vendored
Executable file
@@ -0,0 +1,99 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c708153..0e004da 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -60,10 +60,11 @@ 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)
|
||||
-
|
||||
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 ()
|
||||
include_directories(src/ptex)
|
||||
|
||||
add_subdirectory(src/ptex)
|
||||
+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
|
||||
--- 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)
|
||||
- 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
|
||||
+ )
|
||||
endif()
|
||||
|
||||
install(FILES
|
||||
18
externals/vcpkg/ports/ptex/fix-config.cmake.patch
vendored
Executable file
18
externals/vcpkg/ports/ptex/fix-config.cmake.patch
vendored
Executable file
@@ -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@)
|
||||
47
externals/vcpkg/ports/ptex/portfile.cmake
vendored
Executable file
47
externals/vcpkg/ports/ptex/portfile.cmake
vendored
Executable file
@@ -0,0 +1,47 @@
|
||||
set(PTEX_VER 2.3.2)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO wdas/ptex
|
||||
REF 1b8bc985a71143317ae9e4969fa08e164da7c2e5
|
||||
SHA512 37f2df9ec195f3d69d9526d0dea6a93ef49d69287bfae6ccd9671477491502ea760ed14e3b206b4f488831ab728dc749847b7d176c9b8439fb58b0a0466fe6c5
|
||||
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()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
DISABLE_PARALLEL_CONFIGURE
|
||||
OPTIONS
|
||||
-DPTEX_VER=v${PTEX_VER}
|
||||
-DPTEX_BUILD_SHARED_LIBS=${BUILD_SHARED_LIB}
|
||||
-DPTEX_BUILD_STATIC_LIBS=${BUILD_STATIC_LIB}
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/Ptex)
|
||||
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 "${SOURCE_PATH}/src/doc/License.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
19
externals/vcpkg/ports/ptex/vcpkg.json
vendored
Executable file
19
externals/vcpkg/ports/ptex/vcpkg.json
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "ptex",
|
||||
"version": "2.3.2",
|
||||
"port-version": 4,
|
||||
"description": "Per-Face Texture Mapping for Production Rendering.",
|
||||
"homepage": "https://github.com/wdas/ptex",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
"zlib"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user