aboutsummaryrefslogtreecommitdiff
path: root/ports/tinyobjloader
diff options
context:
space:
mode:
authorDominic Black <me@jdm.black>2018-06-16 04:20:05 +0100
committerRobert Schumacher <roschuma@microsoft.com>2018-06-16 05:20:05 +0200
commit254c5722b17b524986d50184c60a331f626d951d (patch)
tree2458052e653595d4df44266f9104c3f61d266fc1 /ports/tinyobjloader
parent8c77af41ba324050693bfed250726b565cdffec7 (diff)
downloadvcpkg-254c5722b17b524986d50184c60a331f626d951d.tar.gz
vcpkg-254c5722b17b524986d50184c60a331f626d951d.zip
[tinyobjloader] header-only library (#3698)
* Added tinyobjloader header-only library * [tinyobjloader] Use CMake compilation which provides targets
Diffstat (limited to 'ports/tinyobjloader')
-rw-r--r--ports/tinyobjloader/CONTROL3
-rw-r--r--ports/tinyobjloader/portfile.cmake39
2 files changed, 42 insertions, 0 deletions
diff --git a/ports/tinyobjloader/CONTROL b/ports/tinyobjloader/CONTROL
new file mode 100644
index 000000000..16668c167
--- /dev/null
+++ b/ports/tinyobjloader/CONTROL
@@ -0,0 +1,3 @@
+Source: tinyobjloader
+Version: 1.2.0-1
+Description: Tiny but powerful single file wavefront obj loader
diff --git a/ports/tinyobjloader/portfile.cmake b/ports/tinyobjloader/portfile.cmake
new file mode 100644
index 000000000..bc70373a6
--- /dev/null
+++ b/ports/tinyobjloader/portfile.cmake
@@ -0,0 +1,39 @@
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore"))
+ message("tinyobjloader doesn't support dynamic linkage on Windows. Building static instead.")
+ set(VCPKG_LIBRARY_LINKAGE static)
+endif()
+
+include(vcpkg_common_functions)
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO syoyo/tinyobjloader
+ REF 8fd9f6e57bf8c70d5ae47cf0f0d1bf1ccae2dfc2
+ SHA512 5b6a2822989c5a28eabee0a33724c045b5d07cf0ccfd4288c7c3a5a2cc5b0c3f6ee8aca45e8e22c941278fbbfabd8f909f5010cd34b9d905c4d84102d151c73b
+ HEAD_REF master
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" TINYOBJLOADER_COMPILATION_SHARED)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH "${SOURCE_PATH}"
+ PREFER_NINJA
+ OPTIONS
+ -DTINYOBJLOADER_COMPILATION_SHARED=${TINYOBJLOADER_COMPILATION_SHARED}
+ -DCMAKE_INSTALL_DOCDIR:STRING=share/tinyobjloader
+)
+
+vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/tinyobjloader/cmake)
+
+file(
+ REMOVE_RECURSE
+ ${CURRENT_PACKAGES_DIR}/debug/include
+ ${CURRENT_PACKAGES_DIR}/debug/share
+ ${CURRENT_PACKAGES_DIR}/lib/tinyobjloader
+ ${CURRENT_PACKAGES_DIR}/debug/lib/tinyobjloader
+)
+
+vcpkg_copy_pdbs()
+
+# Put the licence file where vcpkg expects it
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/tinyobjloader/LICENSE ${CURRENT_PACKAGES_DIR}/share/tinyobjloader/copyright)