Skip to content

Commit

Permalink
compile/install under vanilla torch7 from dev directory
Browse files Browse the repository at this point in the history
  • Loading branch information
koraykv committed Sep 2, 2011
1 parent c478099 commit 1124c79
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ 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(INSTALL_PREFIX /${Torch_INSTALL_LUA_PATH_SUBDIR}/image)
SET(CINSTALL_PREFIX /${Torch_INSTALL_LUA_CPATH_SUBDIR})
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/image)
SET(CINSTALL_PREFIX /lib)
ENDIF(${CMAKE_PROJECT_NAME} STREQUAL "Torch")

find_package (JPEG QUIET)
Expand All @@ -22,7 +27,7 @@ if (JPEG_FOUND)
include_directories (${JPEG_INCLUDE_DIR} ${TORCH_INCLUDE_DIR} ${PROJECT_SOURCE_DIR})
add_library (jpeg SHARED jpeg.c)
target_link_libraries (jpeg ${TORCH_LIBRARIES} ${JPEG_LIBRARIES})
install_targets (/lib jpeg)
install_targets (${CINSTALL_PREFIX} jpeg)
else (JPEG_FOUND)
message ("WARNING: Could not find JPEG libraries, JPEG wrapper will not be installed")
endif (JPEG_FOUND)
Expand All @@ -31,7 +36,7 @@ if (PNG_FOUND)
include_directories (${PNG_INCLUDE_DIR} ${TORCH_INCLUDE_DIR} ${PROJECT_SOURCE_DIR})
add_library (png SHARED png.c)
target_link_libraries (png ${TORCH_LIBRARIES} ${PNG_LIBRARIES})
install_targets (/lib png)
install_targets (${CINSTALL_PREFIX} png)
else (PNG_FOUND)
message ("WARNING: Could not find PNG libraries, PNG wrapper will not be installed")
endif (PNG_FOUND)
Expand All @@ -41,8 +46,8 @@ add_library (image SHARED image.c)
link_directories (${TORCH_LIBRARY_DIR})
target_link_libraries (image ${TORCH_LIBRARIES})

install_files(/lua/image init.lua)
install_files(/lua/image lena.jpg)
install_files(/lua/image lena.png)
install_files(/lua/image win.ui)
install_targets(/lib image)
install_files(${INSTALL_PREFIX} init.lua)
install_files(${INSTALL_PREFIX} lena.jpg)
install_files(${INSTALL_PREFIX} lena.png)
install_files(${INSTALL_PREFIX} win.ui)
install_targets(${CINSTALL_PREFIX} image)

0 comments on commit 1124c79

Please sign in to comment.