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

[easyloggingpp] how to use it? (missing usage) #36726

Closed
paulbuechner opened this issue Feb 13, 2024 · 2 comments · Fixed by #36851
Closed

[easyloggingpp] how to use it? (missing usage) #36726

paulbuechner opened this issue Feb 13, 2024 · 2 comments · Fixed by #36851
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist

Comments

@paulbuechner
Copy link

paulbuechner commented Feb 13, 2024

Is your feature request related to a problem? Please describe.

When installing easyloggingpp via manifest mode:

{
    "name": "easyloggingpp",
    "version>=": "9.97.1",
    "features": [
      "no-defaultfile",
      "std-locking",
      "thread-safe"
    ]
},

...it states:

easyloggingpp provides pkg-config modules:

    # Feature-rich single header C++ logging library
    easyloggingpp

I'm missing instructions on how to "find" the library in CMake and how to link it.

Proposed solution

Add usage to port.

@paulbuechner paulbuechner added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Feb 13, 2024
@Osyotr
Copy link
Contributor

Osyotr commented Feb 13, 2024

https://cmake.org/cmake/help/latest/module/FindPkgConfig.html

find_package(PkgConfig REQUIRED) 
pkg_check_modules(easyloggingpp REQUIRED IMPORTED_TARGET easyloggingpp)
target_link_libraries(MyTarget PRIVATE PkgConfig::easyloggingpp)

@paulbuechner
Copy link
Author

paulbuechner commented Feb 14, 2024

Actually i was missing the #include <easylogging++.cc> include to successfully compile, which is described here. Maybe we can state this in the usage file then.

Additionally checking if easyloggingpp is present with pkg_check_modules is a good way to prevent issues.

@WangWeiLin-MV WangWeiLin-MV added category:port-update The issue is with a library, which is requesting update new revision and removed category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist labels Feb 19, 2024
vicroms pushed a commit that referenced this issue Feb 21, 2024
Fix #36726 

### Changes
* Patch `easyloggingpp/CMakeLists.txt` to change
`ELPP_PKGCONFIG_INSTALL_DIR` from `share/pkgconfig` to `lib/pkgconfig`.
* Patch `easyloggingpp/cmake/easyloggingpp.pc.cmakein` to add `libdir`
and `Libs`
* Add `usage` about `FindPkgConfig` module

### Checklist

- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [ ] SHA512s are updated for each updated download.
- [ ] ~The "supports" clause reflects platforms that may be fixed by
this new version.~
- [ ] Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.
- [ ] Any patches that are no longer applied are deleted from the port's
directory.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.

Usage test pass with following triplets:
```
x86-windows
x64-linux
x64-windows
x64-windows-static
```
@WangWeiLin-MV WangWeiLin-MV added category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist and removed category:port-update The issue is with a library, which is requesting update new revision labels Feb 23, 2024
TomKatom pushed a commit to TomKatom/vcpkg that referenced this issue Feb 23, 2024
Fix microsoft#36726 

### Changes
* Patch `easyloggingpp/CMakeLists.txt` to change
`ELPP_PKGCONFIG_INSTALL_DIR` from `share/pkgconfig` to `lib/pkgconfig`.
* Patch `easyloggingpp/cmake/easyloggingpp.pc.cmakein` to add `libdir`
and `Libs`
* Add `usage` about `FindPkgConfig` module

### Checklist

- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [ ] SHA512s are updated for each updated download.
- [ ] ~The "supports" clause reflects platforms that may be fixed by
this new version.~
- [ ] Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.
- [ ] Any patches that are no longer applied are deleted from the port's
directory.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.

Usage test pass with following triplets:
```
x86-windows
x64-linux
x64-windows
x64-windows-static
```
Osyotr pushed a commit to Osyotr/vcpkg that referenced this issue Feb 26, 2024
Fix microsoft#36726 

### Changes
* Patch `easyloggingpp/CMakeLists.txt` to change
`ELPP_PKGCONFIG_INSTALL_DIR` from `share/pkgconfig` to `lib/pkgconfig`.
* Patch `easyloggingpp/cmake/easyloggingpp.pc.cmakein` to add `libdir`
and `Libs`
* Add `usage` about `FindPkgConfig` module

### Checklist

- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [ ] SHA512s are updated for each updated download.
- [ ] ~The "supports" clause reflects platforms that may be fixed by
this new version.~
- [ ] Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.
- [ ] Any patches that are no longer applied are deleted from the port's
directory.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.

Usage test pass with following triplets:
```
x86-windows
x64-linux
x64-windows
x64-windows-static
```
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.

3 participants