29
set(ABSL_PROPAGATE_CXX_STD On)
30
set(ABSL_ENABLE_INSTALL Off)
31
set(BUILD_SHARED_LIBS Off)
32
+ set(absl_repo https://github.com/abseil/abseil-cpp)
33
34
message(STATUS "Preparing bundled Abseil (required by bundled Protobuf)")
34
- FetchContent_Declare(absl
35
- GIT_REPOSITORY https://github.com/abseil/abseil-cpp
36
- GIT_TAG ${ABSL_TAG}
37
- CMAKE_ARGS ${NETDATA_CMAKE_PROPAGATE_TOOLCHAIN_ARGS}
38
- )
35
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.28)
36
+ FetchContent_Declare(absl
37
+ GIT_REPOSITORY ${absl_repo}
38
+ GIT_TAG ${ABSL_TAG}
39
+ CMAKE_ARGS ${NETDATA_CMAKE_PROPAGATE_TOOLCHAIN_ARGS}
40
+ EXCLUDE_FROM_ALL
41
+ )
42
+ else()
43
+ FetchContent_Declare(absl
44
+ GIT_REPOSITORY ${absl_repo}
45
+ GIT_TAG ${ABSL_TAG}
46
+ CMAKE_ARGS ${NETDATA_CMAKE_PROPAGATE_TOOLCHAIN_ARGS}
47
+ )
48
+ endif()
49
FetchContent_MakeAvailable_NoInstall(absl)
50
message(STATUS "Finished preparing bundled Abseil")
51
endif()
54
set(protobuf_BUILD_LIBPROTOC Off)
55
set(protobuf_BUILD_TESTS Off)
56
set(protobuf_BUILD_SHARED_LIBS Off)
57
+ set(protobuf_repo https://github.com/protocolbuffers/protobuf)
58
59
message(STATUS "Preparing bundled Protobuf")
49
- FetchContent_Declare(protobuf
50
- GIT_REPOSITORY https://github.com/protocolbuffers/protobuf.git
51
- GIT_TAG ${PROTOBUF_TAG}
52
- CMAKE_ARGS ${NETDATA_CMAKE_PROPAGATE_TOOLCHAIN_ARGS}
53
- )
60
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.28)
61
+ FetchContent_Declare(protobuf
62
+ GIT_REPOSITORY ${protobuf_repo}
63
+ GIT_TAG ${PROTOBUF_TAG}
64
+ CMAKE_ARGS ${NETDATA_CMAKE_PROPAGATE_TOOLCHAIN_ARGS}
65
+ EXCLUDE_FROM_ALL
66
+ )
67
+ else()
68
+ FetchContent_Declare(protobuf
69
+ GIT_REPOSITORY ${protobuf_repo}
70
+ GIT_TAG ${PROTOBUF_TAG}
71
+ CMAKE_ARGS ${NETDATA_CMAKE_PROPAGATE_TOOLCHAIN_ARGS}
72
+ )
73
+ endif()
74
FetchContent_MakeAvailable_NoInstall(protobuf)
75
message(STATUS "Finished preparing bundled Protobuf.")
76