Add pkgconfig to cmake (#5744)
* Add pkgconfig to cmake * Move xgboost.pc.in to cmake/ Co-authored-by: Peter Jung <peter.jung@heureka.cz> Co-authored-by: Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
parent
b77e3e3fcc
commit
0be0e6fd88
@ -57,6 +57,7 @@ address, leak, undefined and thread.")
|
|||||||
## Plugins
|
## Plugins
|
||||||
option(PLUGIN_LZ4 "Build lz4 plugin" OFF)
|
option(PLUGIN_LZ4 "Build lz4 plugin" OFF)
|
||||||
option(PLUGIN_DENSE_PARSER "Build dense parser plugin" OFF)
|
option(PLUGIN_DENSE_PARSER "Build dense parser plugin" OFF)
|
||||||
|
option(ADD_PKGCONFIG "Add xgboost.pc into system." ON)
|
||||||
|
|
||||||
#-- Checks for building XGBoost
|
#-- Checks for building XGBoost
|
||||||
if (USE_DEBUG_OUTPUT AND (NOT (CMAKE_BUILD_TYPE MATCHES Debug)))
|
if (USE_DEBUG_OUTPUT AND (NOT (CMAKE_BUILD_TYPE MATCHES Debug)))
|
||||||
@ -300,3 +301,12 @@ endif (GOOGLE_TEST)
|
|||||||
# replace /MD with /MT. See https://github.com/dmlc/xgboost/issues/4462
|
# replace /MD with /MT. See https://github.com/dmlc/xgboost/issues/4462
|
||||||
# for issues caused by mixing of /MD and /MT flags
|
# for issues caused by mixing of /MD and /MT flags
|
||||||
msvc_use_static_runtime()
|
msvc_use_static_runtime()
|
||||||
|
|
||||||
|
# Add xgboost.pc
|
||||||
|
if (ADD_PKGCONFIG)
|
||||||
|
configure_file(${xgboost_SOURCE_DIR}/cmake/xgboost.pc.in ${xgboost_BINARY_DIR}/xgboost.pc @ONLY)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES ${xgboost_BINARY_DIR}/xgboost.pc
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||||
|
endif (ADD_PKGCONFIG)
|
||||||
|
|||||||
12
cmake/xgboost.pc.in
Normal file
12
cmake/xgboost.pc.in
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
|
version=@xgboost_VERSION@
|
||||||
|
exec_prefix=${prefix}/bin
|
||||||
|
libdir=${prefix}/lib
|
||||||
|
includedir=${prefix}/include
|
||||||
|
|
||||||
|
Name: xgboost
|
||||||
|
Description: XGBoost - Scalable and Flexible Gradient Boosting.
|
||||||
|
Version: ${version}
|
||||||
|
|
||||||
|
Cflags: -I${includedir}
|
||||||
|
Libs: -L${libdir} -lxgboost
|
||||||
Loading…
x
Reference in New Issue
Block a user