File tree 4 files changed +22
-6
lines changed
4 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ endif()
30
30
31
31
# -----------find protobuf lib-----------
32
32
find_package (Protobuf REQUIRED)
33
+ if (${CMAKE_VERSION} VERSION_LESS "3.6.0" )
34
+ set (Protobuf_LIBRARIES ${PROTOBUF_LIBRARIES} )
35
+ set (Protobuf_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIRS} )
36
+ endif ()
33
37
34
38
# -----------set path-----------
35
39
set (SRC_PATH source )
Original file line number Diff line number Diff line change @@ -6,8 +6,12 @@ set(CMAKE_C_STANDARD 99)
6
6
set (CMAKE_CXX_STANDARD 11)
7
7
8
8
find_package (Protobuf REQUIRED)
9
+ if (${CMAKE_VERSION} VERSION_LESS "3.6.0" )
10
+ set (Protobuf_LIBRARIES ${PROTOBUF_LIBRARIES} )
11
+ set (Protobuf_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIRS} )
12
+ endif ()
9
13
10
- include_directories (${PROTOBUF_INCLUDE_DIR } )
14
+ include_directories (${Protobuf_INCLUDE_DIRS } )
11
15
12
16
include_directories (${CMAKE_CURRENT_BINARY_DIR} )
13
17
@@ -21,4 +25,4 @@ include_directories(${CMAKE_SOURCE_DIR}/source/include)
21
25
file (GLOB CAFFE_SRC ${CMAKE_SOURCE_DIR} /source /caffe/*)
22
26
23
27
add_library (caffe SHARED ${CAFFE_SRC} ${CAFFE_PROTO_SRCS} )
24
- target_link_libraries (caffe ${Protobuf_LIBRARIES} )
28
+ target_link_libraries (caffe ${Protobuf_LIBRARIES} )
Original file line number Diff line number Diff line change @@ -6,8 +6,12 @@ set(CMAKE_C_STANDARD 99)
6
6
set (CMAKE_CXX_STANDARD 11)
7
7
8
8
find_package (Protobuf REQUIRED)
9
+ if (${CMAKE_VERSION} VERSION_LESS "3.6.0" )
10
+ set (Protobuf_LIBRARIES ${PROTOBUF_LIBRARIES} )
11
+ set (Protobuf_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIRS} )
12
+ endif ()
9
13
10
- include_directories (${PROTOBUF_INCLUDE_DIR } )
14
+ include_directories (${Protobuf_INCLUDE_DIRS } )
11
15
12
16
include_directories (${CMAKE_CURRENT_BINARY_DIR} )
13
17
@@ -23,4 +27,4 @@ include_directories(${CMAKE_SOURCE_DIR}/source/include)
23
27
24
28
file (GLOB ONNX_SRC ${CMAKE_SOURCE_DIR} /source /onnx/*)
25
29
add_library (onnx SHARED ${ONNX_SRC} ${ONNX_PROTO_SRCS} )
26
- target_link_libraries (onnx ${Protobuf_LIBRARIES} )
30
+ target_link_libraries (onnx ${Protobuf_LIBRARIES} )
Original file line number Diff line number Diff line change @@ -6,8 +6,12 @@ set(CMAKE_C_STANDARD 99)
6
6
set (CMAKE_CXX_STANDARD 11)
7
7
8
8
find_package (Protobuf REQUIRED)
9
+ if (${CMAKE_VERSION} VERSION_LESS "3.6.0" )
10
+ set (Protobuf_LIBRARIES ${PROTOBUF_LIBRARIES} )
11
+ set (Protobuf_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIRS} )
12
+ endif ()
9
13
10
- include_directories (${PROTOBUF_INCLUDE_DIR } )
14
+ include_directories (${Protobuf_INCLUDE_DIRS } )
11
15
12
16
include_directories (${CMAKE_CURRENT_BINARY_DIR} )
13
17
@@ -30,4 +34,4 @@ include_directories(${CMAKE_SOURCE_DIR}/source/include)
30
34
file (GLOB TENSORFLOW_SRC ${CMAKE_SOURCE_DIR} /source /tensorflow/*)
31
35
32
36
add_library (tensorflow SHARED ${TENSORFLOW_SRC} ${TENSORFLOW_PROTO_SRCS} )
33
- target_link_libraries (tensorflow ${Protobuf_LIBRARIES} )
37
+ target_link_libraries (tensorflow ${Protobuf_LIBRARIES} )
You can’t perform that action at this time.
0 commit comments