aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/tinyfiledialogs
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/tinyfiledialogs
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/tinyfiledialogs')
-rw-r--r--vcpkg/ports/tinyfiledialogs/CMakeLists.txt29
-rw-r--r--vcpkg/ports/tinyfiledialogs/portfile.cmake44
-rw-r--r--vcpkg/ports/tinyfiledialogs/vcpkg.json17
3 files changed, 90 insertions, 0 deletions
diff --git a/vcpkg/ports/tinyfiledialogs/CMakeLists.txt b/vcpkg/ports/tinyfiledialogs/CMakeLists.txt
new file mode 100644
index 0000000..c4bbfd2
--- /dev/null
+++ b/vcpkg/ports/tinyfiledialogs/CMakeLists.txt
@@ -0,0 +1,29 @@
+cmake_minimum_required(VERSION 3.4)
+project(tinyfiledialogs C)
+
+add_library(tinyfiledialogs tinyfiledialogs.c)
+
+target_include_directories(tinyfiledialogs INTERFACE $<INSTALL_INTERFACE:include/tinyfiledialogs>)
+
+install(
+ TARGETS tinyfiledialogs
+ EXPORT tinyfiledialogsConfig
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+)
+install(
+ FILES tinyfiledialogs.h
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/include/tinyfiledialogs"
+)
+
+export(
+ TARGETS tinyfiledialogs
+ NAMESPACE tinyfiledialogs::
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/tinyfiledialogsConfig.cmake"
+)
+install(
+ EXPORT tinyfiledialogsConfig
+ NAMESPACE tinyfiledialogs::
+ DESTINATION share/tinyfiledialogs
+)
diff --git a/vcpkg/ports/tinyfiledialogs/portfile.cmake b/vcpkg/ports/tinyfiledialogs/portfile.cmake
new file mode 100644
index 0000000..4a4c9a9
--- /dev/null
+++ b/vcpkg/ports/tinyfiledialogs/portfile.cmake
@@ -0,0 +1,44 @@
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+endif()
+
+# git: not cachable
+# tinyfiledialogs-current.zip: changing SHA512
+# last resort: explicit source files
+# Reviewers may compare git and zip sources at the time of the port update.
+set(ref b071fb40ad9b321408d480a6d1433bf21be01578)
+string(SUBSTRING "${ref}" 0 7 short_ref)
+vcpkg_download_distfile(tinyfiledialogs_c_file
+ URLS "https://sourceforge.net/p/tinyfiledialogs/code/ci/${ref}/tree/tinyfiledialogs.c?format=raw"
+ FILENAME "tinyfiledialogs-${short_ref}.c"
+ SHA512 cc8dd57d47ed9b449d91a66dad421140ef2aa8da00c622c0de3c13c9587ff1b7165343b61e40a2240eef7d15dc27fe28bd4595c89b52e3775060229a7c8a5926
+)
+vcpkg_download_distfile(tinyfiledialogs_h_file
+ URLS "https://sourceforge.net/p/tinyfiledialogs/code/ci/${ref}/tree/tinyfiledialogs.h?format=raw"
+ FILENAME "tinyfiledialogs-${short_ref}.h"
+ SHA512 7b95aa5e32065aee9d16a7cafe644ed93bc9e4cd139882f0298572da1418305ce30d0770e1a6f2b441fb7d9bcb710d57b54ca3c2eb67c9fd5f04c0fdbece31bf
+)
+
+file(READ "${tinyfiledialogs_c_file}" c_source)
+if(NOT c_source MATCHES "tinyfd_version.8. = \"([^\"]*)\"" OR NOT CMAKE_MATCH_1 STREQUAL VERSION)
+ message(FATAL_ERROR "Source doesn't declare match version ${VERSION}.")
+elseif(NOT c_source MATCHES [[- License -[\r\n]*(.*)]])
+ message(FATAL_ERROR "Failed to parse license from tinyfiledialogs.c")
+endif()
+string(REGEX REPLACE " *__*.*" "" license "${CMAKE_MATCH_1}")
+
+set(source_path "${CURRENT_BUILDTREES_DIR}/src/${short_ref}")
+file(MAKE_DIRECTORY "${source_path}")
+file(COPY_FILE "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" "${source_path}/CMakeLists.txt")
+file(COPY_FILE "${tinyfiledialogs_c_file}" "${source_path}/tinyfiledialogs.c")
+file(COPY_FILE "${tinyfiledialogs_h_file}" "${source_path}/tinyfiledialogs.h")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${source_path}"
+)
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "${license}")
diff --git a/vcpkg/ports/tinyfiledialogs/vcpkg.json b/vcpkg/ports/tinyfiledialogs/vcpkg.json
new file mode 100644
index 0000000..944e45d
--- /dev/null
+++ b/vcpkg/ports/tinyfiledialogs/vcpkg.json
@@ -0,0 +1,17 @@
+{
+ "name": "tinyfiledialogs",
+ "version": "3.19.1",
+ "description": "Highly portable and cross-platform dialogs for native inputbox, passwordbox, colorpicker and more",
+ "homepage": "https://sourceforge.net/projects/tinyfiledialogs/",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}