CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.6)
IF(LUAROCKS_PREFIX)
  MESSAGE(STATUS "Installing iTorch through Luarocks")
  STRING(REGEX REPLACE "(.*)lib/luarocks/rocks.*" "\\1" CMAKE_INSTALL_PREFIX  "${LUAROCKS_PREFIX}")
  MESSAGE(STATUS "Prefix inferred from Luarocks: ${CMAKE_INSTALL_PREFIX}")
ENDIF()
FIND_PACKAGE(Torch REQUIRED)

FILE(GLOB luasrc *.lua static/jquery-1.11.2.min.js static/bokeh-0.7.0.min.js  static/bokeh-0.7.0.min.css)
SET(src "")
ADD_TORCH_PACKAGE(itorch "${src}" "${luasrc}" "iTorch")
