Skip to content

Commit

Permalink
Fixes to FindXGBoost.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
peremato committed Jan 15, 2019
1 parent 3b38bca commit 26224b8
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions modules/FindXGBoost.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
###############################################################################
# (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
# - Locate XGBoost library
# Defines:
#
Expand All @@ -17,26 +7,21 @@
# XGBoost_LIBRARY
# XGBoost_LIBRARIES (not cached)
# XGBoost_LIBRARY_DIRS (not cached)
# XGBoost_EXTRA_INCLUDE_DIR


find_path(XGBoost_INCLUDE_DIR xgboost/c_api.h
HINTS $ENV{XGBoost_ROOT_DIR}/include ${XGBoost_ROOT_DIR}/include)

find_path(XGBoost_EXTRA_INCLUDE_DIR rabit/c_api.h
HINTS ${XGBoost_INCLUDE_DIR}/../rabit/include
$ENV{XGBoost_ROOT_DIR}/rabit/include ${XGBoost_ROOT_DIR}/rabit/include)

find_library(XGBoost_LIBRARY NAMES xgboost
HINTS $ENV{XGBoost_ROOT_DIR}/lib ${XGBoost_ROOT_DIR}/lib)

# handle the QUIETLY and REQUIRED arguments and set XGBoost_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XGBoost DEFAULT_MSG XGBoost_INCLUDE_DIR XGBoost_LIBRARY XGBoost_EXTRA_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XGBoost DEFAULT_MSG XGBoost_INCLUDE_DIR XGBoost_LIBRARY)

mark_as_advanced(XGBoost_FOUND XGBoost_INCLUDE_DIR XGBoost_LIBRARY XGBoost_EXTRA_INCLUDE_DIR)
mark_as_advanced(XGBoost_FOUND XGBoost_INCLUDE_DIR XGBoost_LIBRARY )

set(XGBoost_INCLUDE_DIRS ${XGBoost_INCLUDE_DIR} ${XGBoost_EXTRA_INCLUDE_DIR})
set(XGBoost_INCLUDE_DIRS ${XGBoost_INCLUDE_DIR})
set(XGBoost_LIBRARIES ${XGBoost_LIBRARY})
get_filename_component(XGBoost_LIBRARY_DIRS ${XGBoost_LIBRARY} PATH)

0 comments on commit 26224b8

Please sign in to comment.