xgboost/cmake/xgboost-config.cmake.in
Jiaming Yuan 345796825f
Optional find dependency in installed cmake config. (#7099)
* Find dependency only when xgboost is built as static library.
* Resolve msvc warning.
* Add test for linking shared library.
2021-07-11 17:20:55 +08:00

26 lines
623 B
CMake

@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(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}\")")