forked from szagoruyko/loadcaffe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (24 loc) · 959 Bytes
/
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
37
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.6)
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
FIND_PACKAGE(Torch REQUIRED)
FIND_PACKAGE(Protobuf REQUIRED)
INCLUDE_DIRECTORIES("${Torch_INSTALL_INCLUDE}/TH" ${PROTOBUF_INCLUDE_DIRS})
LINK_DIRECTORIES("${Torch_INSTALL_LIB}")
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS caffe.proto)
SET(src loadcaffe.cpp ${PROTO_SRCS})
FILE(GLOB luasrc *.lua)
add_definitions(-std=c++11)
ADD_LIBRARY(loadcaffe MODULE ${src})
TARGET_LINK_LIBRARIES(loadcaffe TH ${PROTOBUF_LIBRARIES})
### Torch packages supposes libraries prefix is "lib"
SET_TARGET_PROPERTIES(loadcaffe PROPERTIES
PREFIX "lib"
IMPORT_PREFIX "lib")
INSTALL(TARGETS loadcaffe
RUNTIME DESTINATION "${Torch_INSTALL_LUA_CPATH_SUBDIR}"
LIBRARY DESTINATION "${Torch_INSTALL_LUA_CPATH_SUBDIR}")
INSTALL(
FILES
${luasrc}
DESTINATION "${Torch_INSTALL_LUA_PATH_SUBDIR}/loadcaffe")