jeremyong/klein

vcpkg integration

Opened this issue ยท 5 comments

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.

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

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.

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

I created a pull request with the changes. Thanks!

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