-
Notifications
You must be signed in to change notification settings - Fork 26
/
CMakeLists.txt
35 lines (26 loc) · 1019 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.6)
FIND_PACKAGE(Torch REQUIRED)
ADD_SUBDIRECTORY(sgd)
ADD_SUBDIRECTORY(liblinear)
ADD_SUBDIRECTORY(libsvm)
SET(utilsrc init.c data.c util.c)
ADD_LIBRARY(svmutil MODULE ${utilsrc})
TARGET_LINK_LIBRARIES(svmutil luaT TH)
IF(LUALIB)
TARGET_LINK_LIBRARIES(svmutil ${LUALIB})
ELSE(LUALIB)
FIND_LIBRARY(LUAJIT_LIBRARIES luajit ${LUA_LIBDIR})
IF (NOT ${LUAJIT_LIBRARIES} MATCHES "LUAJIT_LIBRARIES-NOTFOUND")
MESSAGE("Found LuaJIT, linking with: " ${LUAJIT_LIBRARIES})
TARGET_LINK_LIBRARIES(svmutil luajit)
ELSE(${LUAJIT_LIBRARIES})
MESSAGE("Did not find LuaJIT, attempting to link with vanilla Lua")
TARGET_LINK_LIBRARIES(svmutil lua)
ENDIF(${LUAJIT_LIBRARIES})
ENDIF(LUALIB)
INSTALL(TARGETS svmutil LIBRARY DESTINATION ${Torch_INSTALL_LUA_CPATH_SUBDIR})
SET(src)
SET(luasrc init.lua data.lua)
ADD_TORCH_PACKAGE(svm "${src}" "${luasrc}")