forked from elikosan/cunn
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
29 lines (21 loc) · 850 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.8)
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
FIND_PACKAGE(Torch REQUIRED)
FIND_PACKAGE(CUDA 6.5 REQUIRED)
INCLUDE_DIRECTORIES("${Torch_INSTALL_INCLUDE}/THC")
LINK_DIRECTORIES("${Torch_INSTALL_LIB}")
FILE(STRINGS lib/THCUNN/THCUNN.h THCUNN_headers NEWLINE_CONSUME)
FILE(WRITE THCUNN_h.lua "return [[")
FILE(APPEND THCUNN_h.lua ${THCUNN_headers})
FILE(APPEND THCUNN_h.lua "]]")
FILE(STRINGS lib/THCUNN/generic/THCUNN.h THCUNN_generic_headers NEWLINE_CONSUME)
FILE(WRITE THCUNN_generic_h.lua "return [[")
FILE(APPEND THCUNN_generic_h.lua ${THCUNN_generic_headers})
FILE(APPEND THCUNN_generic_h.lua "]]")
FILE(GLOB luasrc *.lua)
ADD_SUBDIRECTORY(lib)
INSTALL(
FILES
${luasrc}
DESTINATION "${Torch_INSTALL_LUA_PATH_SUBDIR}/cunn")