Skip to content

Commit

Permalink
Add missing user-defined xgboost-config.cmake.in
Browse files Browse the repository at this point in the history
  • Loading branch information
titsuki committed Aug 26, 2023
1 parent 9a8514a commit 8e9514d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions misc/xgboost-config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@PACKAGE_INIT@

set(USE_OPENMP @USE_OPENMP@)
set(USE_CUDA @USE_CUDA@)
set(USE_NCCL @USE_NCCL@)
set(XGBOOST_BUILD_STATIC_LIB @BUILD_STATIC_LIB@)

include(CMakeFindDependencyMacro)

if (XGBOOST_BUILD_STATIC_LIB)
find_dependency(Threads)
if(USE_OPENMP)
find_dependency(OpenMP)
endif()
if(OpenMP_CXX_FOUND)
target_link_libraries(MyTarget PUBLIC OpenMP::OpenMP_CXX)
endif()
if(USE_CUDA)
find_dependency(CUDA)
endif()
# nccl should be linked statically if xgboost is built as static library.
endif (XGBOOST_BUILD_STATIC_LIB)

if(NOT TARGET xgboost::xgboost)
include(${CMAKE_CURRENT_LIST_DIR}/XGBoostTargets.cmake)
endif()

message(STATUS "Found XGBoost (found version \"${xgboost_VERSION}\")")

0 comments on commit 8e9514d

Please sign in to comment.