-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Allow LightGBM to be easily used in external projects via modern CMake style with find_package
and target_link_libraries
#4067
Comments
Thanks very much for your interest in LightGBM! The guide you attached looks helpful. Could you point to a project that you use that has |
zlib has pkg-config support. They do this by having a I will also be happy to contribute if you think it is worth having. |
For the reference, see how huge refactoring was required for XGBoost to achieve this goal: dmlc/xgboost#4323 (comment). To be honest, I'm quite sceptical about that |
find_package
and target_link_libraries
Closed in favor of being in #2302. We decided to keep all feature requests in one place. Welcome to contribute this feature! Please re-open this issue (or post a comment if you are not a topic starter) if you are actively working on implementing this feature. |
Also, for pkg-config example refer to dmlc/xgboost#5744. |
Summary
Generate pkg-config file for the library.
Motivation
pkg-config is a widely used way to provide linker flags and include directories for use in other projects. For example, with cmake, a project can just call
find_package(LightGBM REQUIRED)
and it will set the include directories and linker flags.Note this applies to use cases when precompiled lightgbm is installed in a system/container. This doesn't apply to projects building with lightgbm with
add_subdirectory
.Description
Generate a
.pc
file as part of the build.References
https://people.freedesktop.org/~dbn/pkg-config-guide.html
The text was updated successfully, but these errors were encountered: