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

add cmake package config #709

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akallabeth
Copy link

@akallabeth akallabeth commented Jul 12, 2023

create and install CMake package config files so find_package(libfido2) can be used.

@LDVG
Copy link
Contributor

LDVG commented Jul 13, 2023

Hi,

A couple of questions from our side:

  • Is the mechanism we provide today (pkg-config) insufficient for some reason?
  • As far as I can see, this only sets a variable containing the package version and a variable containing the include path. For a consumer to actually link with libfido2, surely more details are required (e.g. exported targets)?

@akallabeth
Copy link
Author

@LDVG yes, did forget that one, added it, sorry.
as for why: with find_package you can have a build that is working on platforms that do not provide pkg-config as well

Copy link
Contributor

@LDVG LDVG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the context. Added a few more questions in-line.

@@ -0,0 +1,10 @@
set(FIDO_VERSION @FIDO_VERSION@)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it canonical to set a variable like this? I was under the impression that this was already handled by write_basic_package_version_file() (albeit under a slightly different variable name).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, write_basic_package_version_file provides it under a different name, so I did define this. can change it though.

Comment on lines +5 to +6
set_and_check(FIDO_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set_and_check(FIDO_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these necessary given the exported targets (maybe needs INCLUDES DESTINATION)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, indeed. https://cmake.org/cmake/help/latest/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.html seems to be what should be set for the target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants