aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/ankurvdev-embedresource/portfile.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/ankurvdev-embedresource/portfile.cmake')
-rw-r--r--vcpkg/ports/ankurvdev-embedresource/portfile.cmake33
1 files changed, 33 insertions, 0 deletions
diff --git a/vcpkg/ports/ankurvdev-embedresource/portfile.cmake b/vcpkg/ports/ankurvdev-embedresource/portfile.cmake
new file mode 100644
index 0000000..87e7b75
--- /dev/null
+++ b/vcpkg/ports/ankurvdev-embedresource/portfile.cmake
@@ -0,0 +1,33 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO ankurvdev/embedresource
+ REF "v${VERSION}"
+ SHA512 0a26a0b554e743b4f4987c4414cfcca6d2207e8ac038a1701cdb5068ddc6cc9438deda8037ce93145c4f1434ae97d7737bbc875d7367aa14726fd16511e8421a
+ HEAD_REF main)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH ${SOURCE_PATH}
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+# Handle copyright
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
+if(HOST_TRIPLET STREQUAL TARGET_TRIPLET) # Otherwise fails on wasm32-emscripten
+ vcpkg_copy_tools(TOOL_NAMES embedresource AUTO_CLEAN)
+else()
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
+endif()
+
+file(READ "${CURRENT_PACKAGES_DIR}/share/embedresource/EmbedResourceConfig.cmake" config_contents)
+file(WRITE "${CURRENT_PACKAGES_DIR}/share/embedresource/EmbedResourceConfig.cmake"
+"find_program(
+ embedresource_EXECUTABLE embedresource
+ PATHS
+ \"\${CMAKE_CURRENT_LIST_DIR}/../../../${HOST_TRIPLET}/tools/${PORT}\"
+ NO_DEFAULT_PATH
+ REQUIRED)
+${config_contents}"
+)