diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/tmxlite | |
Diffstat (limited to 'vcpkg/ports/tmxlite')
| -rw-r--r-- | vcpkg/ports/tmxlite/dependencies.patch | 29 | ||||
| -rw-r--r-- | vcpkg/ports/tmxlite/portfile.cmake | 38 | ||||
| -rw-r--r-- | vcpkg/ports/tmxlite/vcpkg.json | 20 |
3 files changed, 87 insertions, 0 deletions
diff --git a/vcpkg/ports/tmxlite/dependencies.patch b/vcpkg/ports/tmxlite/dependencies.patch new file mode 100644 index 0000000..e061806 --- /dev/null +++ b/vcpkg/ports/tmxlite/dependencies.patch @@ -0,0 +1,29 @@ +diff --git a/tmxlite/CMakeLists.txt b/tmxlite/CMakeLists.txt +index a1b1882..8c0aad6 100644 +--- a/tmxlite/CMakeLists.txt ++++ b/tmxlite/CMakeLists.txt +@@ -68,10 +68,9 @@ if(USE_EXTLIBS) + SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") + + find_package(ZLIB REQUIRED) +- find_package(PUGIXML REQUIRED) +- find_package(Zstd REQUIRED) ++ find_package(pugixml CONFIG REQUIRED) ++ find_package(zstd CONFIG REQUIRED) + +- include_directories(${ZLIB_INCLUDE_DIRS} ${PUGIXML_INCLUDE_DIR} ${ZSTD_INCLUDE_DIR}) + + else() + #add miniz and pugixml from source +@@ -102,7 +101,10 @@ else() + endif() + + if(USE_EXTLIBS) +- target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES} ${PUGIXML_LIBRARY} ${ZSTD_LIBRARY}) ++ target_link_libraries(${PROJECT_NAME} PRIVATE ++ $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static> ++ pugixml::pugixml ++ ZLIB::ZLIB) + else() + if(USE_ZSTD) + target_link_libraries(${PROJECT_NAME} ${ZSTD_LIBRARY}) diff --git a/vcpkg/ports/tmxlite/portfile.cmake b/vcpkg/ports/tmxlite/portfile.cmake new file mode 100644 index 0000000..592746d --- /dev/null +++ b/vcpkg/ports/tmxlite/portfile.cmake @@ -0,0 +1,38 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO fallahn/tmxlite
+ REF "v${VERSION}"
+ HEAD_REF master
+ SHA512 0ffe0505329f00ef9872998673a7c220a9a5352f830688ef17952c0c4f001e0c2994a3a28f0e7de60cc82fff2701561cccbc2143fd51984bf4870e7d1fd0a2ba
+ PATCHES
+ dependencies.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" TMXLITE_STATIC_LIB)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}/tmxlite"
+ OPTIONS
+ -DTMXLITE_STATIC_LIB=${TMXLITE_STATIC_LIB}
+ -DUSE_EXTLIBS=ON
+ -DPKGCONF_REQ_PUB=pugixml
+)
+
+vcpkg_cmake_install()
+
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+set(STATIC_POSTFIX "")
+if(TMXLITE_STATIC_LIB)
+ set(STATIC_POSTFIX "-s")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/tmxlite.pc" "-ltmxlite" "-ltmxlite${STATIC_POSTFIX}")
+endif()
+
+if(NOT VCPKG_BUILD_TYPE)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/tmxlite.pc" "-ltmxlite" "-ltmxlite${STATIC_POSTFIX}-d")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/tmxlite/vcpkg.json b/vcpkg/ports/tmxlite/vcpkg.json new file mode 100644 index 0000000..80a34c8 --- /dev/null +++ b/vcpkg/ports/tmxlite/vcpkg.json @@ -0,0 +1,20 @@ +{ + "name": "tmxlite", + "version": "1.4.4", + "description": "A lightweight C++14 parsing library for tmx map files created with the Tiled map editor.", + "homepage": "https://github.com/fallahn/tmxlite", + "license": "Zlib", + "dependencies": [ + "pugixml", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib", + "zstd" + ] +} |