Skip to content

Commit 325c2b2

Browse files
authored
Fix cmake deprecation failure coming from 3rd party (#279)
* Update json commit * Align cmake min version across the project * Update cmake in tests
1 parent 9efe90c commit 325c2b2

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/cpp/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ find_package(OpenVINO REQUIRED
3737
COMPONENTS Runtime Threading)
3838

3939
include(FetchContent)
40-
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
40+
FetchContent_Declare(json GIT_REPOSITORY https://github.com/nlohmann/json.git
41+
GIT_TAG d41ca94fa85d5119852e2f7a3f94335cc7cb0486 # PR #4709, fixes cmake deprecation warnings
42+
)
4143
FetchContent_MakeAvailable(json)
4244

4345
file(GLOB MODELS_SOURCES ./models/src/*.cpp)

tests/cpp/accuracy/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ endif()
5454
include(CMakeParseArguments)
5555
include(FetchContent)
5656

57-
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz)
57+
FetchContent_Declare(json GIT_REPOSITORY https://github.com/nlohmann/json.git
58+
GIT_TAG d41ca94fa85d5119852e2f7a3f94335cc7cb0486 # PR #4709, fixes cmake deprecation warnings
59+
)
5860
FetchContent_Declare(googletest
5961
GIT_REPOSITORY https://github.com/google/googletest.git
6062
GIT_TAG a7f443b80b105f940225332ed3c31f2790092f47 # latest main

tests/cpp/cmake/common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

5-
cmake_minimum_required(VERSION 3.11)
5+
cmake_minimum_required(VERSION 3.26)
66

77
macro(add_test)
88
set(oneValueArgs NAME OPENCV_VERSION_REQUIRED)

tests/cpp/precommit/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ endif()
5353
include(CMakeParseArguments)
5454
include(FetchContent)
5555

56-
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz)
56+
FetchContent_Declare(json GIT_REPOSITORY https://github.com/nlohmann/json.git
57+
GIT_TAG d41ca94fa85d5119852e2f7a3f94335cc7cb0486 # PR #4709, fixes cmake deprecation warnings
58+
)
5759
FetchContent_Declare(googletest
5860
GIT_REPOSITORY https://github.com/google/googletest.git
5961
GIT_TAG a7f443b80b105f940225332ed3c31f2790092f47 # latest main

0 commit comments

Comments
 (0)