-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
36 lines (31 loc) · 1.17 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
# Check OpenCV
if(NOT USE_OPENCV OR NOT OpenCV_FOUND)
message(WARNING "\
OpenCV should be enabled and found to build image classification example, skipping...")
return()
endif()
if(NOT MSVC)
set(IMG_CLASSIFICATION_EXAMPLE_STATIC_LINK ON CACHE BOOL "\
Link mxnet library statically in the c++ image classification example")
else()
# disable static linking on Windows
set(IMG_CLASSIFICATION_EXAMPLE_STATIC_LINK OFF)
endif()
add_executable(image-classification-predict image-classification-predict.cc)
include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS})
if(IMG_CLASSIFICATION_EXAMPLE_STATIC_LINK)
target_link_libraries(image-classification-predict
${BEGIN_WHOLE_ARCHIVE} mxnet_static ${END_WHOLE_ARCHIVE}
dmlc
${mxnet_LINKER_LIBS}
)
add_dependencies(image-classification-predict mxnet_static)
else()
target_link_libraries(image-classification-predict
dmlc
${nnvm_LINKER_LIBS}
${mxnet_LINKER_LIBS}
mxnet
)
add_dependencies(image-classification-predict mxnet)
endif()