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

[pkgconfig] Vcpkg integrate does not work at all. #20689

Closed
acidtonic opened this issue Oct 12, 2021 · 8 comments
Closed

[pkgconfig] Vcpkg integrate does not work at all. #20689

acidtonic opened this issue Oct 12, 2021 · 8 comments
Assignees
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly Stale

Comments

@acidtonic
Copy link

Installed gtkmm for the x64-windows triplet.

Ran vcpkg integrate.

I am pointing my cmake toolchain to the file it mentioned.... specifically changed my pkg_check_modules() to find_package() like the docs say and it doesn't work.

passing -DCMAKE_TOOLCHAIN_FILE and -DVCPKG_TARGET_TRIPLET="x64-windows".

Still doesn't find gtkmm-4.0 that it built and has the .pc file for. Am I supposed to override pkg-config too or is that supposed to work unmodified with that toolchain file?

@JackBoosY JackBoosY added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Oct 13, 2021
@dg0yt
Copy link
Contributor

dg0yt commented Oct 13, 2021

I think you still have to provide some pkg-config executable, e.g. pkgconf from that vcpkg port, via cmake or environment variables.

@JackBoosY JackBoosY changed the title Vcpkg integrate does not work at all. [pkgconfig] Vcpkg integrate does not work at all. Nov 17, 2021
@thehans
Copy link
Contributor

thehans commented Dec 17, 2021

I was also having issues getting pkg-config to work in my own project, even though it is used to build various vcpkg-provided dependencies which my project depends on.

I ended up installing pkgconf, which is technically a different project than pkg-config, but still meant to be compatible.
The only issue is that the exe filename provided is pkgconf.exe instead of pkg-config.exe, and since cmake's builtin FindPkgConfig only seems to look for pkg-config.exe, it fails to find it.

vcpkg install pkgconf

As a workaround I provide both exe names to find and set PKG_CONFIG_EXECUTABLE in my project's CMakeLists.txt, before calling find_package (i'm not sure if it even matters to call find_package at that point, but at least it doesn't seem to hurt):

  find_program(PKG_CONFIG_EXECUTABLE NAMES pkgconf.exe pkg-config.exe)
  find_package(PkgConfig REQUIRED)

@JackBoosY
Copy link
Contributor

@thehans Yes, for pkgconfig, vcpkg still need to handle something and provides the usage in output and toolchain.

@Neumann-A
Copy link
Contributor

@thehans Then your cmake version is lower than 3.22. 3.22 added pkgconf as a search name.

@thehans
Copy link
Contributor

thehans commented Dec 18, 2021

@Neumann-A I'm just using whatever cmake is bundled with VS2019 and VS2022 respectively.

@JackBoosY
Copy link
Contributor

Will be fixed partly by #21456.

@LilyWangLL LilyWangLL assigned LilyWangLL and unassigned JackBoosY Dec 6, 2022
@BillyONeal
Copy link
Member

I believe this is a "won't fix forever" situation: MSBuild has no equivalent of reading of a .pc file or CMake Config files, so if a port needs / expects those to apply to function, msbuild customers can't use that port.

MSBuild integration works fine with all libraries that follow normal "your headers go in include, your libs go in lib, and your binaries go in bin" conventions.

Without MSBuild supporting the equivalent of pkgconfig or CMake Configs inside itself there's little we can do.

Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@github-actions github-actions bot added the Stale label Aug 15, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly Stale
Projects
None yet
Development

No branches or pull requests

7 participants