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

[jemalloc] Generate cmake target files. #10243

Open
ayermolo opened this issue Feb 27, 2020 · 9 comments
Open

[jemalloc] Generate cmake target files. #10243

ayermolo opened this issue Feb 27, 2020 · 9 comments
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist

Comments

@ayermolo
Copy link

For other projects in share folder [port]-targets.cmake, [port]-targets-debug.cmake, [port]-targets-release.cmake are created. This allows for user projects that use vcpkgs ports to use find_package to link against instaled ports. For jemalloc these files are not generated. It would be very useful if this was enabled, and simplify cmake files on user side.

@ayermolo ayermolo added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Feb 27, 2020
@ayermolo
Copy link
Author

@NancyLi1013 Hi. Any update on this? Would it be possible to do?

@NancyLi1013
Copy link
Contributor

Hi @ayermolo

Thanks for posting this issue.
Sorry for the late reply.
Since we need more time to fix bug now. This issue might be lower priority to be handled.
Currently, you might use this port via find_library() and find_path().

@NickStrupat
Copy link
Contributor

I've seen this issue while trying to consume a couple of ports (the other being antlr4).

Is there vcpkg documentation on how to add this to a port. Are the folks who successfully add these target file exports just CMake sorcerers?

@dg0yt
Copy link
Contributor

dg0yt commented May 30, 2021

Providing cmake config files ("[port]-targets.cmake, [port]-targets-debug.cmake, [port]-targets-release.cmake" etc.) should generally be done by, or requested from, the upstream software project (assuming it is using cmake).

If cmake has a find module ("FindPort.cmake") and it doesn't work sufficiently for vcpkg, a port can install a file share/port/vcpk-cmake-wrapper.cmake which can execute additional cmake commands before and/or after calling the original find module. Example:
https://github.com/microsoft/vcpkg/blob/master/ports/libjpeg-turbo/vcpkg-cmake-wrapper.cmake
Note that consuming ports need to declare a dependency on the providing port for the wrapper to take effect.

@NickStrupat
Copy link
Contributor

Interesting. Thank you for the explanation and example.

I find that it greatly reduces the QoE of vcpkg when a package I want to consume needs more than a find_package and target_link_libraries call after adding it to a vcpkg.json.

Do you think it would be sensible to add a test to the package CI builds? That way, over time, packages would require proper targets to pass the CI build before merge.

@dg0yt
Copy link
Contributor

dg0yt commented May 31, 2021

@NickStrupat I don't want to make a general comment about testing in vcpkg. With regard to cmake config files, there is one related draft PR: #15173.

@JackBoosY
Copy link
Contributor

For PR #15173, my goal is to test the properties of the generated targets to ensure that they can be used normally.

@Neumann-A
Copy link
Contributor

@JackBoosY Close. jemalloc is not a cmake port so we shouldn't add this.

@JackBoosY
Copy link
Contributor

@JackBoosY Close. jemalloc is not a cmake port so we shouldn't add this.

I think we can make a jemalloc-config.cmake.in to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants