Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/distro.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@fb.com>2016-02-01 05:46:23 +0300
committerSoumith Chintala <soumith@fb.com>2016-02-01 05:46:23 +0300
commit70766191bb58260b3dcd645191ccdedfb6bef321 (patch)
treeca1284089acda1f0003329fdebecb57b60e7f5bc /CMakeLists.txt
parent45aa69786d8d2c76a591ad329dc79de20c12eee2 (diff)
non-luarocks install fixes
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 15 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 712d48b..98bdaae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 2.8)
ADD_SUBDIRECTORY(exe)
-# If this variable is defined, a pure cmake build is done end-to-end with no luarocks needed
-IF (DEFINED TORCH_DISTRO_CMAKE_BUILD)
+# If this variable is defined, a pure cmake build is done end-to-end with no luarocks
+IF (WITH_LUAROCKS STREQUAL OFF)
# LUA_INCDIR - place where lua headers exist
# LUA_LIBDIR - place where lua libraries exist
@@ -31,15 +31,24 @@ IF (DEFINED TORCH_DISTRO_CMAKE_BUILD)
MESSAGE(STATUS "LIBDIR: ${LIBDIR}")
ENDIF(NOT DEFINED ${LIBDIR})
- ADD_SUBDIRECTORY(pkg)
-
# add torch defs
- SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_INSTALL_PREFIX}/share/cmake/torch)
+ # this is done to fake compliance with FIND_PACKAGE(Torch)
+ SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake" "${CMAKE_MODULE_PATH}")
+
+ # These are needed variables for all the ADD_TORCH_PACKAGE macros
+ INCLUDE_DIRECTORIES(${LUA_INCDIR})
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/pkg/torch/lib/TH")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/pkg/torch/lib/TH")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/pkg/torch/lib/luaT")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/pkg/torch/lib/luaT")
+ SET(Torch_INSTALL_LUA_PATH_SUBDIR ${LUADIR})
+ SET(Torch_INSTALL_LUA_CPATH_SUBDIR ${LIBDIR})
+ SET(Torch_INSTALL_LIB ${LUA_LIBDIR})
+ SET(Torch_INSTALL_LIB_SUBDIR ${LUA_LIBDIR})
+ # Finally add the two directories
+ ADD_SUBDIRECTORY(pkg)
ADD_SUBDIRECTORY(extra)
-ENDIF (DEFINED TORCH_DISTRO_CMAKE_BUILD)
+ENDIF (WITH_LUAROCKS STREQUAL OFF)