Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

vcpkg integration #16

Open
JPMMaia opened this issue Apr 23, 2021 · 5 comments
Open

vcpkg integration #16

JPMMaia opened this issue Apr 23, 2021 · 5 comments

Comments

@JPMMaia
Copy link
Contributor

JPMMaia commented Apr 23, 2021

Hi!

I am using vcpkg to manage dependencies on a project and I was wondering if I could use vcpkg to include klein in my project.

So I wrote a port file and made some changes to klein's CMakeLists.txt so that it creates a config package when running CMake install. Packages created this way can be included in other CMake projects by using:

find_package(klein 2.3.0 REQUIRED) // Version 2.3.0 is used as an example here
target_link_libraries(app PRIVATE klein::klein) // Other available targets are klein::klein_cxx11 and klein::klein_sse42

I was wondering if you would find these changes interesting and worth adding to the project. The changes can be seen in
create-config-package.zip. I can open a pull request with the changes if you are interested.

@jeremyong
Copy link
Owner

@JPMMaia a PR to supply a vcpkg port file is more than welcome! Thanks for looking into that

@JPMMaia
Copy link
Contributor Author

JPMMaia commented Apr 24, 2021

I created a vcpkg port for Klein that I can add to upstream soon.

In order to make the vcpkg port files as simple as possible, I created a patch for Klein's CMakeLists.txt that adds some install() commands. These new commands create a CMake config-file package for Klein, according to these instructions. This enables other projects to find Klein by using find_package(klein 2.3.0 REQUIRED).

What do you think about adding these changes directly to Klein's repository through a new pull request? This way, we can remove the patch from vcpkg's port and make it really simple. In addition, this would also make it easier creating future packages for Klein.

@jeremyong
Copy link
Owner

I'd be open to having those changes directly integrated. That said, it'd be nice to have an option to not have the install targets specified at all, and default the option to disabled if the package is included transitively in another cmake project. Thanks again for working on that

@JPMMaia
Copy link
Contributor Author

JPMMaia commented May 8, 2021

I created a pull request with the changes. Thanks!

@JPMMaia
Copy link
Contributor Author

JPMMaia commented Jun 5, 2021

Thanks for the review!
I created a pull request in vcpkg to add Klein support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants