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

github.com/torch/image.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkoray kavukcuoglu <koray@kavukcuoglu.org>2011-09-01 23:39:13 +0400
committerkoray kavukcuoglu <koray@kavukcuoglu.org>2011-09-01 23:39:13 +0400
commitc478099a1ad87a1446f802259f8a70cfe4ea5b37 (patch)
tree1522f608624705b93bd3b7a8381c4289d098f742 /CMakeLists.txt
parentf1ef42a2e645d8af56e49c993dfe7017bf7a0330 (diff)
make it work with vanilla torch7 installation under dev directory
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 10 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 36659f9..5cbcff9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,11 +2,17 @@ cmake_minimum_required(VERSION 2.8)
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
-# infer path for Torch7
-string (REGEX REPLACE "(.*)lib/luarocks/rocks.*" "\\1" TORCH_PREFIX "${CMAKE_INSTALL_PREFIX}" )
-message (STATUS "Found Torch7, installed in: " ${TORCH_PREFIX})
+IF(${CMAKE_PROJECT_NAME} STREQUAL "Torch")
+ SET(TORCH_LIBRARIES TH luaT)
+ SET(TORCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+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)
+ENDIF(${CMAKE_PROJECT_NAME} STREQUAL "Torch")
-find_package (Torch REQUIRED)
find_package (JPEG QUIET)
find_package (PNG QUIET)