File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Project dependencies
22find_package (Armadillo REQUIRED )
33find_package (Boost REQUIRED COMPONENTS regex serialization )
4+ find_package (LIGHTGBM REQUIRED )
45find_package (OpenMP REQUIRED )
56find_package (Python3 REQUIRED COMPONENTS Development NumPy )
67
Original file line number Diff line number Diff line change 1+ # Find the LightGBM includes and library
2+ #
3+ # This module defines the following IMPORTED targets:
4+ #
5+ # LightGBM::lightgbm - The LightGBM library, if found.
6+ #
7+ # This module will set the following variables in your project:
8+ #
9+ # LIGHTGBM_INCLUDE_DIRS - where to find <LightGBM/c_api.h>, etc.
10+ # LIGHTGBM_FOUND - True if the LightGBM library has been found.
11+
12+ find_package (PkgConfig QUIET )
13+ if (PKG_CONFIG_FOUND)
14+ pkg_check_modules (PC_LIGHTGBM QUIET lightgbm )
15+ endif ()
16+
17+ find_path (
18+ LIGHTGBM_INCLUDE_DIR lightgbm
19+ NAMES LightGBM/c_api.h
20+ HINTS ${PC_LIGHTGBM_INCLUDEDIR} ${PC_LIGHTGBM_INCLUDE_DIRS}
21+ PATH_SUFFIXES include
22+ )
23+
24+ if (PC_LIGHTGBM_VERSION)
25+ # Version extracted from pkg-config
26+ set (LIGHTGBM_VERSION_STRING ${PC_LIGHTGBM_VERSION} )
27+ endif ()
28+
29+ # Handle find_package() arguments (i.e. QUIETLY and REQUIRED) and set
30+ # LIGHTGBM_FOUND to TRUE if all listed variables are filled.
31+ include (FindPackageHandleStandardArgs )
32+ find_package_handle_standard_args (
33+ LIGHTGBM
34+ REQUIRED_VARS LIGHTGBM_INCLUDE_DIR
35+ VERSION_VAR LIGHTGBM_VERSION_STRING
36+ )
37+
38+ set (LIGHTGBM_INCLUDE_DIRS ${LIGHTGBM_INCLUDE_DIR} )
39+ mark_as_advanced (LIGHTGBM_INCLUDE_DIR )
40+
Original file line number Diff line number Diff line change 11set (LIBWIF_SOURCES
22 classifiers/classifier.cpp
33 classifiers/ipPrefixClassifier.cpp
4+ classifiers/lightGBMClassifier.cpp
45 classifiers/mlpackClassifier.cpp
56 classifiers/regexClassifier.cpp
67 classifiers/scikitMlClassifier.cpp
@@ -9,6 +10,7 @@ set(LIBWIF_SOURCES
910 combinators/majorityCombinator.cpp
1011 combinators/sumCombinator.cpp
1112 filesystem/fileModificationChecker.cpp
13+ ml/lightGBMWrapper.cpp
1214 ml/mlpackModels/decisionTreeModel.cpp
1315 ml/mlpackModels/hoeffdingTreeModel.cpp
1416 ml/mlpackModels/linearSVMModel.cpp
@@ -45,13 +47,6 @@ if(BUILD_WITH_UNIREC)
4547 )
4648endif ()
4749
48- if (BUILD_WITH_LIGHTGBM)
49- list (APPEND LIBWIF_SOURCES
50- classifiers/lightGBMClassifier.cpp
51- ml/lightGBMWrapper.cpp
52- )
53- endif ()
54-
5550add_library (wif SHARED ${LIBWIF_SOURCES} )
5651target_link_libraries (wif PRIVATE ${LIBWIF_LIBS} )
5752target_include_directories (wif PUBLIC ${CMAKE_SOURCE_DIR} /include )
You can’t perform that action at this time.
0 commit comments