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

[plibsys] plibsys_FOUND is not set after find_package(plibsys) #38875

Closed
PatrickKa opened this issue May 22, 2024 · 4 comments · Fixed by #42518
Closed

[plibsys] plibsys_FOUND is not set after find_package(plibsys) #38875

PatrickKa opened this issue May 22, 2024 · 4 comments · Fixed by #42518
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@PatrickKa
Copy link

PatrickKa commented May 22, 2024

Describe the bug

The documentation of find_package() states that it sets <PackageName>_FOUND. However, after I call find_package(plibsys CONFIG REQUIRED) in my CML file, plibsys_FOUND is not set. I am not sure if this bug is directly related to vcpkg, but when I wanted to check the CMake config file in .../vcpkg/installed/x64-windows/share/plibsys I only found vcpkg-cmake-wrapper.cmake which manually sets PLIBSYS_INCLUDE_DIRS and PLIBSYS_LIBRARIES. Therefore, I thought that this wrapper might also be responsible for manually setting plibsys_FOUND.

The way how I discovered this was via find_dependency(plibsys) in a CMake config file of "MyCMakeProject", which throws an error stating that it cannot find plibsys which is very weird because find_package(plibsys CONFIG REQUIRED) does not throw an error and building "MyCMakeProject" works.

Environment

  • OS: Windows
  • Compiler: MSVC 19.39.33523 for x64

To Reproduce

Steps to reproduce the behavior:

  1. ./vcpkg install plibsys
  2. Create simple example CMake project that calls find_package(plibsys CONFIG REQUIRED) and print the value of plibsys_FOUND afterwards.
  3. Nothing will be printed

Repro code:

cmake_minimum_required(VERSION 3.27)
project(MyCMakeProject VERSION 1.0.0 LANGUAGES CXX)
find_package(plibsys CONFIG REQUIRED)
message("----- plibsys_FOUND = ${plibsys_FOUND}")

Expected behavior

plibsys_FOUND is set to 0 or 1 after the find_package() call

Failure logs

Found package configuration file:
[cmake] 
[cmake]     C:/Program Files (x86)/MyCMakeProject/share/MyCMakeProject/MyCMakeProjectConfig.cmake
[cmake] 
[cmake]   but it set MyCMakeProject_FOUND to FALSE so package "MyCMakeProject" is
[cmake]   considered to be NOT FOUND.  Reason given by package:
[cmake] 
[cmake]   MyCMakeProject could not be found because dependency plibsys could not be
[cmake]   found.

Additional context
Add any other context about the problem here.

@dg0yt
Copy link
Contributor

dg0yt commented May 22, 2024

Vcpkg port bug. Instead of a proper CMake config, the port installs an improper vcpkg cmake "wrapper".

For now, you might get away with find_package(PLIBSYS REQUIRED).

@MonicaLiu0311 MonicaLiu0311 self-assigned this May 23, 2024
@MonicaLiu0311 MonicaLiu0311 added the category:port-bug The issue is with a library, which is something the port should already support label May 23, 2024
@PatrickKa
Copy link
Author

Thx for the fast answer.

Yeah, this is what I am using in my package config file for now.

Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@MonicaLiu0311
Copy link
Contributor

I will make updates and changes accordingly once new versions are released upstream:
saprykin/plibsys#110
saprykin/plibsys#112

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.

3 participants