-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·47 lines (36 loc) · 1.33 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
46
cmake_minimum_required(VERSION 2.8)
project(NANOEnPer_V1)
find_package(Threads)
find_package(OpenCV REQUIRED)
#如下为新加的
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
#如上为新加的
set(CMAKE_CXX_STANDARD 11)
set(GLOG_LIB glog)
set(CMAKE_CXX_STANDARD_REQUIRED true)
set(OpenCV_DIR /usr/local/share/OpenCV)
include_directories(./include
/home/leon/CAFFE/caffe/include #caffe路径
/usr/local/cuda/include
/home/leon/CAFFE/caffe/build/src
${GLOG_LIB}
${OpenCV_INCLUDE_DIRS})
aux_source_directory(./sources DIR_SRCS)
#设置debug模式,当需要用vscode的时候开启
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
add_executable(NANOEnPer_V1 ${DIR_SRCS})
target_link_libraries(NANOEnPer_V1
/home/leon/CAFFE/caffe/build/lib/libcaffe.so
/usr/lib/aarch64-linux-gnu/libglog.so
/usr/lib/aarch64-linux-gnu/libboost_system.so
${CMAKE_THREAD_LIBS_INIT}
${OpenCV_LIBS})