skypjack / uvw

Header-only, event based, tiny and easy to use libuv wrapper in modern C++ - now available as also shared/static library!
MIT License
1.84k stars 209 forks source link

CMake package configuration files for uvw #245

Closed moodyhunter closed 2 years ago

moodyhunter commented 3 years ago

As uvw is a CMake-based project, it currently, however, uses pkg-config as the package manager. It's better to be compatible with native CMake packages a.k.a cmake-packages because:

  1. A CMake-based package will simplify the use of uvw by just two lines of CMake commands
    find_package(uvw CONFIG REQUIRED)
    target_link_libraries(main PRIVATE uvw::uvw)
  2. allow downstream developers to use uvw in the same way, regardless of the platform and package manager: (currently, find_package for vcpkg-based, but for the AUR package, we need pkg-config)

This involves some extra CMake commands to the CMakeLists.txt , a minimal working version of that from vcpkg can be found here: https://github.com/microsoft/vcpkg/tree/master/ports/uvw

skypjack commented 3 years ago

The library already exports the uvw::uvw alias to use to link to your target (when BUILD_UVW_LIBS isn't set). Not sure I get what you are asking for other than this. Can you provide more details or open a PR for that?

moodyhunter commented 3 years ago

Hi @skypjack sorry for the late reply, I've opened a PR https://github.com/skypjack/uvw/pull/246 containing the fix I mentioned above. Feel free to review and make any suggestions.

skypjack commented 3 years ago

Hi, no late at all. Can I ask you to fix the conflicts on the CMakeLists.txt file? We had some changes to merge and I've just realized that they have some problems with your PR. Thanks and sorry for it.

skypjack commented 2 years ago

I guess we can close this one since the PR was merged already. 🙂