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/inih | |
Diffstat (limited to 'vcpkg/ports/inih')
| -rw-r--r-- | vcpkg/ports/inih/portfile.cmake | 44 | ||||
| -rw-r--r-- | vcpkg/ports/inih/unofficial-inihConfig.cmake.in | 60 | ||||
| -rw-r--r-- | vcpkg/ports/inih/usage | 7 | ||||
| -rw-r--r-- | vcpkg/ports/inih/vcpkg.json | 21 |
4 files changed, 132 insertions, 0 deletions
diff --git a/vcpkg/ports/inih/portfile.cmake b/vcpkg/ports/inih/portfile.cmake new file mode 100644 index 0000000..1363cdb --- /dev/null +++ b/vcpkg/ports/inih/portfile.cmake @@ -0,0 +1,44 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO benhoyt/inih + REF "r${VERSION}" + SHA512 206ddfaa55d29396c3a44f8d1dfcf578c5ebf892e81fe875cd6b4ec2af5cccf400ca13fc6585b6d8232bd122bd8aef7522bfc83898b5609b29c20bad9390ee02 + HEAD_REF master +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + cpp with_INIReader +) + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + set(INIH_CONFIG_DEBUG ON) +else() + set(INIH_CONFIG_DEBUG OFF) +endif() + +# Install unofficial CMake package +configure_file("${CMAKE_CURRENT_LIST_DIR}/unofficial-inihConfig.cmake.in" "${CURRENT_PACKAGES_DIR}/share/unofficial-inih/unofficial-inihConfig.cmake" @ONLY) + +# meson build +string(REPLACE "OFF" "false" FEATURE_OPTIONS "${FEATURE_OPTIONS}") +string(REPLACE "ON" "true" FEATURE_OPTIONS "${FEATURE_OPTIONS}") + +vcpkg_configure_meson( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + "${FEATURE_OPTIONS}" + "-Dcpp_std=c++11" +) + +vcpkg_install_meson() +vcpkg_fixup_pkgconfig() + +vcpkg_copy_pdbs() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") + +configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY) diff --git a/vcpkg/ports/inih/unofficial-inihConfig.cmake.in b/vcpkg/ports/inih/unofficial-inihConfig.cmake.in new file mode 100644 index 0000000..d6b61fc --- /dev/null +++ b/vcpkg/ports/inih/unofficial-inihConfig.cmake.in @@ -0,0 +1,60 @@ +if(TARGET unofficial::inih::libinih)
+ return()
+endif()
+
+set(INIH_WITH_INI_READER @with_INIReader@)
+set(INIH_WITH_DEBUG @INIH_CONFIG_DEBUG@)
+
+# Compute the installation prefix relative to this file.
+get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+
+###################
+#### libinih ####
+
+add_library(unofficial::inih::libinih UNKNOWN IMPORTED)
+
+find_library(INIH_INIHLIB_RELEASE NAMES inih PATHS "${_IMPORT_PREFIX}/lib/" REQUIRED NO_DEFAULT_PATH)
+set_target_properties(unofficial::inih::libinih PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION_RELEASE "${INIH_INIHLIB_RELEASE}"
+ IMPORTED_CONFIGURATIONS "RELEASE"
+)
+
+if(INIH_WITH_DEBUG)
+ set_property(TARGET unofficial::inih::libinih APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+ find_library(INIH_INIHLIB_DEBUG NAMES inih PATHS "${_IMPORT_PREFIX}/debug/lib/" REQUIRED NO_DEFAULT_PATH)
+ set_target_properties(unofficial::inih::libinih PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${INIH_INIHLIB_DEBUG}"
+ )
+endif()
+
+#### libinih ####
+###################
+#### INIReader ####
+
+if(INIH_WITH_INI_READER)
+ add_library(unofficial::inih::inireader UNKNOWN IMPORTED)
+
+ find_library(INIH_INIREADER_RELEASE NAMES INIReader PATHS "${_IMPORT_PREFIX}/lib/" REQUIRED NO_DEFAULT_PATH)
+ set_target_properties(unofficial::inih::inireader PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C;CXX"
+ IMPORTED_LOCATION_RELEASE "${INIH_INIREADER_RELEASE}"
+ INTERFACE_LINK_LIBRARIES "unofficial::inih::libinih"
+ IMPORTED_CONFIGURATIONS "RELEASE"
+ )
+
+ if(INIH_WITH_DEBUG)
+ set_property(TARGET unofficial::inih::inireader APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+ find_library(INIH_INIREADER_DEBUG NAMES INIReader PATHS "${_IMPORT_PREFIX}/debug/lib/" NO_DEFAULT_PATH)
+ set_target_properties(unofficial::inih::inireader PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${INIH_INIREADER_DEBUG}"
+ )
+ endif()
+endif()
+
+#### INIReader ####
+###################
diff --git a/vcpkg/ports/inih/usage b/vcpkg/ports/inih/usage new file mode 100644 index 0000000..227be04 --- /dev/null +++ b/vcpkg/ports/inih/usage @@ -0,0 +1,7 @@ +The package inih provides unofficial CMake targets:
+ find_package(unofficial-inih CONFIG REQUIRED)
+ # C API
+ target_link_libraries(main PRIVATE unofficial::inih::libinih)
+ # C++ API (Requires "cpp" feature)
+ target_link_libraries(main PRIVATE unofficial::inih::inireader)
+Alternatively, if you are using pckgconfig use the name "inih" for the C API and "inireader" for the C++ API
diff --git a/vcpkg/ports/inih/vcpkg.json b/vcpkg/ports/inih/vcpkg.json new file mode 100644 index 0000000..435aa36 --- /dev/null +++ b/vcpkg/ports/inih/vcpkg.json @@ -0,0 +1,21 @@ +{ + "name": "inih", + "version": "62", + "description": "Simple .INI file parser", + "homepage": "https://github.com/benhoyt/inih", + "license": "BSD-3-Clause", + "dependencies": [ + { + "name": "vcpkg-tool-meson", + "host": true + } + ], + "default-features": [ + "cpp" + ], + "features": { + "cpp": { + "description": "Build the C++ library" + } + } +} |