forked from clementfarabet/lua---camera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (32 loc) · 1.09 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.6)
IF(LUAROCKS_PREFIX)
MESSAGE(STATUS "Installing Torch 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)
if (UNIX AND NOT APPLE)
add_subdirectory (opencv)
add_subdirectory (video4linux)
endif (UNIX AND NOT APPLE)
if (APPLE)
add_subdirectory (opencv)
if (OpenCV_FOUND)
set(useOpenCV "true")
else()
if(NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
message (ERROR "clang is required to build libcammacos")
endif()
set(useOpenCV "false")
add_subdirectory (macos)
endif()
endif (APPLE)
if (NOT UNIX)
message (ERROR "This package only builds on Unix platforms")
endif (NOT UNIX)
SET(src)
SET(luasrc "${CMAKE_BINARY_DIR}/init.lua")
configure_file(init.lua.in "${luasrc}")
install_files(/lua/camera "${luasrc}")
ADD_TORCH_PACKAGE(camera "${src}" "${luasrc}" "Image Processing")