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

libpng find_package broken #7968

Closed
sjdrc opened this issue Aug 29, 2019 · 3 comments · Fixed by #7972
Closed

libpng find_package broken #7968

sjdrc opened this issue Aug 29, 2019 · 3 comments · Fixed by #7972
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@sjdrc
Copy link
Contributor

sjdrc commented Aug 29, 2019

Describe the bug
When installing libpng and attempting to use through cmake, I get the error in the log section below.

Package installed correctly and I followed the instructions it gave:

The package libpng:x64-linux provides CMake targets:

    find_package(libpng CONFIG REQUIRED)
    target_link_libraries(main PRIVATE png_static)

Environment

  • OS: Ubuntu 18.04
  • Compiler: gcc 7.4.0/cmake 3.14.3

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install libpng
  2. In my project's CMakeLists.txt do find_package(libpng CONFIG REQUIRED)

Expected behavior
I should be able to find libpng with find_package

Failure logs

CMake Error at /home/sebastien/.ezvcpkg/2019.07/scripts/buildsystems/vcpkg.cmake:266 (_find_package):
  Could not find a package configuration file provided by "libpng" with any
  of the following names:

    libpngConfig.cmake
    libpng-config.cmake

  Add the installation prefix of "libpng" to CMAKE_PREFIX_PATH or set
  "libpng_DIR" to a directory containing one of the above files.  If "libpng"
  provides a separate development package or SDK, be sure it has been
  installed.

Additional context
vcpkg folder installed/x64-linux/share/libpng contains the following files:

libpng16.cmake
libpng16-debug.cmake
libpng16-release.cmake

Renaming to:

libpngConfig.cmake
libpngConfig-debug.cmake
libpngConfig-release.cmake

lets cmake find the package as expected.

@cbezault cbezault added the category:port-bug The issue is with a library, which is something the port should already support label Aug 29, 2019
@vicroms
Copy link
Member

vicroms commented Aug 29, 2019

Hi @sjdrc

PR #7972 should fix this issue.

I will note, that the traditional way to include libpng is by using the built-in CMake module (call find_package(PNG REQUIRED) instead).

@sjdrc
Copy link
Contributor Author

sjdrc commented Aug 29, 2019

Ah right, if that is the case, should the The package libpng:x64-linux provides CMake targets: message recommend using find_package(PNG REQUIRED) instead?

@vicroms
Copy link
Member

vicroms commented Aug 29, 2019

The message is auto-generated by vcpkg when config files are detected, in this case it can be overridden by providing a usage file.

However, once the PR is merged both find_package(libpng CONFIG) and find_package(PNG MODULE) will work.

vicroms added a commit that referenced this issue Aug 30, 2019
* Fix find_package(libpng CONFIG)

* Fix typos
malfrancis pushed a commit to moja-global/vcpkg that referenced this issue Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants