-
Notifications
You must be signed in to change notification settings - Fork 169
/
CMakeLists.txt
45 lines (35 loc) · 1.14 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
37
38
39
40
41
42
43
44
45
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.8)
ADD_SUBDIRECTORY(cunnproduction)
FIND_PACKAGE(CUDA 5.5 REQUIRED)
FIND_PACKAGE(Torch)
ADD_DEFINITIONS(-std=c++11 -fPIC)
IF(DEFINED Torch_INSTALL_INCLUDE)
SET(THC_INSTALL_INCLUDE ${Torch_INSTALL_INCLUDE})
SET(TH_INSTALL_INCLUDE ${Torch_INSTALL_INCLUDE})
SET(TH_INSTALL_LIB ${Torch_INSTALL_LIB})
SET(THC_INSTALL_LIB ${Torch_INSTALL_LIB})
SET(THCUNN_INSTALL_LIB ${Torch_INSTALL_LIB}/lua/5.1)
ENDIF()
INCLUDE_DIRECTORIES(
${THC_INSTALL_INCLUDE}/THC
${THC_INSTALL_INCLUDE}
${TH_INSTALL_INCLUDE}/TH
${TH_INSTALL_INCLUDE}
${CUDA_INCLUDE_DIRS}
cunnproduction
)
LINK_DIRECTORIES(
${TH_INSTALL_LIB}
${THC_INSTALL_LIB}
${THCUNN_INSTALL_LIB}
)
ADD_LIBRARY(loader_static STATIC src/loader.cpp)
ADD_LIBRARY(wrapper_static STATIC src/wrapper.cpp)
ADD_EXECUTABLE(test_networks src/test.cpp)
IF(WITH_OPENCV)
ADD_SUBDIRECTORY(opencv)
ENDIF()
TARGET_LINK_LIBRARIES(test_networks cunnproduction_static TH THC loader_static)
TARGET_LINK_LIBRARIES(loader_static TH THC cunnproduction_static)
TARGET_LINK_LIBRARIES(wrapper_static TH THC cunnproduction_static loader_static)