1 ############################################################################## 2 # @file FindLIBLINEAR.cmake 3 # @brief Find LIBLINEAR package. 5 # @par Input varibales: 8 # @tp @b LIBLINEAR_DIR @endtp 9 # <td>The LIBLINEAR package files are searched primarily under the specified 10 # root directory. This variable can be alternatively set as environment 14 # @tp @b MEX_EXT @endtp 15 # <td>The extension of MEX-files. If this variable is not set and the 16 # basis_mexext command is available, it is invoked to determine the 17 # extension automatically. Otherwise, the MEX extension defaults to 22 # @par Output variables: 25 # @tp @b LIBLINEAR_FOUND @endtp 26 # <td>Whether the package was found and the following CMake variables are valid.</td> 29 # @tp @b LIBLINEAR_libsvmwrite_MEX @endtp 30 # <td>The libsvmwrite MEX-file.</td> 33 # @tp @b LIBLINEAR_libsvmread_MEX @endtp 34 # <td>The libsvmread MEX-file.</td> 37 # @tp @b LIBLINEAR_predict_MEX @endtp 38 # <td>The predict MEX-file.</td> 41 # @tp @b LIBLINEAR_train_MEX @endtp 42 # <td>The train MEX-file.</td> 45 # @tp @b LIBLINEAR_MEX_FILES @endtp 46 # <td>List of MEX-files (non-cached).</td> 50 # @ingroup CMakeFindModules 51 ############################################################################## 53 #============================================================================= 54 # Copyright 2011-2012 University of Pennsylvania 55 # Copyright 2013-2016 Andreas Schuh <andreas.schuh.84@gmail.com> 57 # Distributed under the OSI-approved BSD License (the "License"); 58 # see accompanying file Copyright.txt for details. 60 # This software is distributed WITHOUT ANY WARRANTY; without even the 61 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 62 # See the License for more information. 63 #============================================================================= 64 # (To distribute this file outside of CMake, substitute the full 65 # License text for the above reference.) 67 # ---------------------------------------------------------------------------- 70 set (LIBLINEAR_DIR
"$ENV{LIBLINEAR_DIR}" CACHE PATH
"Installation prefix for LIBLINEAR." FORCE)
77 set (MEX_EXT "mexa64")
81 #-------------------------------------------------------------- 86 LIBLINEAR_libsvmwrite_MEX
87 NAMES libsvmwrite.${MEX_EXT}
88 HINTS ${LIBLINEAR_DIR}
89 PATH_SUFFIXES
"matlab" 90 DOC
"The libsvmwrite MEX-file of the LIBLINEAR library." 95 LIBLINEAR_libsvmread_MEX
96 NAMES libsvmread.${MEX_EXT}
97 HINTS ${LIBLINEAR_DIR}
98 PATH_SUFFIXES
"matlab" 99 DOC
"The libsvmread MEX-file of the LIBLINEAR library." 105 NAMES train.${MEX_EXT}
106 HINTS ${LIBLINEAR_DIR}
107 PATH_SUFFIXES
"matlab" 108 DOC
"The train MEX-file of the LIBLINEAR library." 113 LIBLINEAR_predict_MEX
114 NAMES predict.${MEX_EXT}
115 HINTS ${LIBLINEAR_DIR}
116 PATH_SUFFIXES
"matlab" 117 DOC
"The predict MEX-file of the LIBLINEAR library." 124 LIBLINEAR_libsvmwrite_MEX
125 NAMES libsvmwrite.${MEX_EXT}
126 PATH_SUFFIXES
"matlab" 127 DOC
"The libsvmwrite MEX-file of the LIBLINEAR library." 131 LIBLINEAR_libsvmread_MEX
132 NAMES libsvmread.${MEX_EXT}
133 PATH_SUFFIXES
"matlab" 134 DOC
"The libsvmread MEX-file of the LIBLINEAR library." 139 NAMES train.${MEX_EXT}
140 PATH_SUFFIXES
"matlab" 141 DOC
"The train MEX-file of the LIBLINEAR library." 145 LIBLINEAR_predict_MEX
146 NAMES predict.${MEX_EXT}
147 PATH_SUFFIXES
"matlab" 148 DOC
"The predict MEX-file of the LIBLINEAR library." 153 mark_as_advanced (LIBLINEAR_libsvmread_MEX)
154 mark_as_advanced (LIBLINEAR_libsvmwrite_MEX)
155 mark_as_advanced (LIBLINEAR_train_MEX)
156 mark_as_advanced (LIBLINEAR_predict_MEX)
158 set (LIBLINEAR_MEX_FILES)
159 if (LIBLINEAR_libsvmread_MEX)
160 list (APPEND LIBLINEAR_MEX_FILES "${LIBLINEAR_libsvmread_MEX}
") 162 if (LIBLINEAR_libsvmwrite_MEX) 163 list (APPEND LIBLINEAR_MEX_FILES "${LIBLINEAR_libsvmwrite_MEX}
") 165 if (LIBLINEAR_train_MEX) 166 list (APPEND LIBLINEAR_MEX_FILES "${LIBLINEAR_train_MEX}
") 168 if (LIBLINEAR_predict_MEX) 169 list (APPEND LIBLINEAR_MEX_FILES "${LIBLINEAR_predict_MEX}
") 172 # ---------------------------------------------------------------------------- 173 # handle the QUIETLY and REQUIRED arguments and set *_FOUND to TRUE 174 # if all listed variables are found or TRUE 175 include (FindPackageHandleStandardArgs) 177 find_package_handle_standard_args ( 182 LIBLINEAR_libsvmwrite_MEX 183 LIBLINEAR_libsvmread_MEX 184 LIBLINEAR_predict_MEX 188 # ---------------------------------------------------------------------------- 190 if (NOT LIBLINEAR_DIR AND LIBLINEAR_FOUND) 191 string (REGEX REPLACE "matlab/[^/]+
" "" LIBLINEAR_PREFIX "${LIBLINEAR_train_MEX}
") 192 set (LIBLINEAR_DIR "${LIBLINEAR_PREFIX}
" CACHE PATH "Installation prefix
for LIBLINEAR.
" FORCE) 193 unset (LIBLINEAR_PREFIX)
function basis_mexext(out ARGN)
Determine extension of MEX-files for this architecture.