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

vcpkg is now difficult to use. #209

Open
cmaughan opened this issue Oct 2, 2023 · 5 comments
Open

vcpkg is now difficult to use. #209

cmaughan opened this issue Oct 2, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@cmaughan
Copy link

cmaughan commented Oct 2, 2023

The latest vcpkg for tomlplusplus now requires pkgconfig, which is a seperate install on windows. Previously I could just add tomlplusplus to my CMakelists.txt. I tried adding the extra PkgConfig stuff, and tried to install the extra findpackage binaries on windows, but gave up. I've just copied tomlplusplus into my tree.

@cmaughan cmaughan added the bug Something isn't working label Oct 2, 2023
@marzer
Copy link
Owner

marzer commented Oct 2, 2023

Ah that sucks. I don't know much about vcpkg but I'll look into at some point. Thanks for letting me know :)

gottyduke added a commit to gottyduke/DKUtil that referenced this issue Dec 14, 2023
@davidharabagiu
Copy link

Installing pkgconfig using choco worked for me:

choco install pkgconfiglite

You could also use the vcpkg port for toml++ 3.1.0 which doesn't require PkgConfig.

@cdacamar
Copy link

Is there any way of reverting the offending change? Taking a dependency on PkgConfig for a straight-forward library (it's usable as header-only) seems like massive overkill.

@gkoreman
Copy link

+1 to this. The PkgConfig dependency on vcpkg seriously detracts from the allure of a header only library.

@user-45-20
Copy link

As far as I can tell this is because natively tomlplusplus uses meson instead of CMake, and while meson does have support for generating targets files that can be consumed by CMake, there are some issues with that in the current version of tomlplusplus, so I guess the vcpkg maintainers decided not to bother.

One obvious issue I found is this in src/meson.build: lib_name = tomlplusplus_lib.full_path().split('/')[-1] - on Windows the path separator is \ so you end up with an absolute path in lib_name which is then put into the CMake targets file. I remember there being more issues though.

For anyone else who runs into this, as a workaround you can either pin your vcpkg version of the library at 3.2.0 which didn't have this problem, or to use the latest 3.4.0 release, you can create an overlay portfile which builds and installs the library through CMake instead as the project still has CMakeLists.txt:

vcpkg_from_github(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO marzer/tomlplusplus
    REF v3.4.0
    SHA512 c227fc8147c9459b29ad24002aaf6ab2c42fac22ea04c1c52b283a0172581ccd4527b33c1931e0ef0d1db6b6a53f9e9882c6d4231c7f3494cf070d0220741aa5
    HEAD_REF "v${VERSION}"
)

vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/tomlplusplus)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
# this is created but useless as the library is header only, so we get a warning
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants