CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.6)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../torch7/lib/TH)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../torch7/lib/TH)
ADD_SUBDIRECTORY(lib)

FILE(STRINGS lib/THNN/generic/THNN.h THNN_headers NEWLINE_CONSUME)
FILE(WRITE THNN_h.lua "return [[")
FILE(APPEND THNN_h.lua ${THNN_headers})
FILE(APPEND THNN_h.lua "]]")

FILE(GLOB luasrc *.lua)

ADD_TORCH_PACKAGE(nn "" "${luasrc}")
