diff options
| author | myd7349 <myd7349@gmail.com> | 2019-09-23 13:56:40 +0800 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-09-22 22:56:40 -0700 |
| commit | 5926563c775381f4f50de0076babb21d37b88369 (patch) | |
| tree | e2be9e3d90d2f0f2fd8d500feac7192b80eb39dc | |
| parent | 5c5c9ea14626bc137e10c6db8206f70b382498c1 (diff) | |
| download | vcpkg-5926563c775381f4f50de0076babb21d37b88369.tar.gz vcpkg-5926563c775381f4f50de0076babb21d37b88369.zip | |
[cute-headers] Add new port (#8277)
| -rw-r--r-- | ports/cute-headers/CONTROL | 4 | ||||
| -rw-r--r-- | ports/cute-headers/portfile.cmake | 32 |
2 files changed, 36 insertions, 0 deletions
diff --git a/ports/cute-headers/CONTROL b/ports/cute-headers/CONTROL new file mode 100644 index 000000000..f3b98ff56 --- /dev/null +++ b/ports/cute-headers/CONTROL @@ -0,0 +1,4 @@ +Source: cute-headers
+Version: 2019-09-20
+Description: Collection of cross-platform one-file C/C++ libraries with no dependencies
+Homepage: https://github.com/RandyGaul/cute_headers
diff --git a/ports/cute-headers/portfile.cmake b/ports/cute-headers/portfile.cmake new file mode 100644 index 000000000..703496d94 --- /dev/null +++ b/ports/cute-headers/portfile.cmake @@ -0,0 +1,32 @@ +# header-only library
+
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO RandyGaul/cute_headers
+ REF 4f765abf4a59660e72f9f49c444371ba373e834b
+ SHA512 e898520dc668ce9d1f51c748da1c674f9fa0540bac7a0d10a45fde5ebb0ca6573dc5178ce41199a138e3153343b1ff0c589bc7908a8edcd4a7753d5a1440030b
+ HEAD_REF master
+)
+
+file(GLOB CUTE_HEADERS_FILES ${SOURCE_PATH}/*.h)
+file(COPY ${CUTE_HEADERS_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
+
+# Handle copyright
+file(STRINGS "${SOURCE_PATH}/cute_math2d.h" SOURCE_LINES)
+list(REVERSE SOURCE_LINES)
+
+set(line_no 0)
+foreach(line ${SOURCE_LINES})
+ math(EXPR line_no "${line_no} + 1")
+ if(line STREQUAL "/*")
+ break()
+ endif()
+endforeach()
+
+list(SUBLIST SOURCE_LINES 0 ${line_no} SOURCE_LINES)
+list(REVERSE SOURCE_LINES)
+list(JOIN SOURCE_LINES "\n" _contents)
+
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "${_contents}")
|
