forked from clementfarabet/lua---nng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
25 lines (20 loc) · 873 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
cmake_minimum_required(VERSION 2.8)
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
IF(${CMAKE_PROJECT_NAME} STREQUAL "Torch")
SET(TORCH_LIBRARIES TH luaT)
SET(TORCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
SET(TORCH_TH TH)
SET(TORCH_luaT luaT)
SET(INSTALL_PREFIX /${Torch_INSTALL_LUA_PATH_SUBDIR}/nng)
SET(CINSTALL_PREFIX /${Torch_INSTALL_LUA_CPATH_SUBDIR})
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR})
SET(LIBS ${TORCH_LIBRARIES} ${LUA_LIBRARIES})
ELSE(${CMAKE_PROJECT_NAME} STREQUAL "Torch")
# infer path for Torch7
string (REGEX REPLACE "(.*)lib/luarocks/rocks.*" "\\1" TORCH_PREFIX "${CMAKE_INSTALL_PREFIX}" )
message (STATUS "Found Torch7, installed in: " ${TORCH_PREFIX})
find_package (Torch REQUIRED)
SET(INSTALL_PREFIX /lua)
SET(CINSTALL_PREFIX /lib)
ENDIF(${CMAKE_PROJECT_NAME} STREQUAL "Torch")
install_files(${INSTALL_PREFIX} g.lua)