Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tomlplusplus] Add new port #10786

Merged
merged 8 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ports/tomlplusplus/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Source: tomlplusplus
Version: 1.3.0-3
Homepage: https://marzer.github.io/tomlplusplus/
Description: Header-only TOML config file parser and serializer for modern C++.
Supports: !(arm|uwp|linux|osx)
24 changes: 24 additions & 0 deletions ports/tomlplusplus/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "linux" "osx" "uwp")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO marzer/tomlplusplus
REF v1.3.0
SHA512 3c758c59f4bddfc646b596c358909f37c35d3e7200bd04663bf8c6493c2f64797352dd8a788e68bcc1a785fa41ac2dfc5621bf5328018748bdc3c5cea621b3bc
HEAD_REF master
)

vcpkg_configure_meson(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS -DGENERATE_CMAKE_CONFIG=enabled
-DBUILD_TESTS=disabled
-DBUILD_EXAMPLES=disabled
)

vcpkg_install_meson()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
4 changes: 4 additions & 0 deletions scripts/cmake/vcpkg_fixup_cmake_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ function(vcpkg_fixup_cmake_targets)
"get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\./(\\.\\./)*\" ABSOLUTE\\)"
"get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)"
_contents "${_contents}")
string(REGEX REPLACE
"get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\.((\\\\|/)\\.\\.)*\" ABSOLUTE\\)"
"get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)"
_contents "${_contents}") # This is a meson-related workaround, see https://github.com/mesonbuild/meson/issues/6955
#Fix wrongly absolute paths to install dir with the correct dir using ${_IMPORT_PREFIX}
string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${_IMPORT_PREFIX}]] _contents "${_contents}")
file(WRITE ${MAIN_CMAKE} "${_contents}")
Expand Down