Skip to content

Commit 402a1e2

Browse files
committed
Merge remote-tracking branch 'origin/fix/cmake-compatibility-issues' into fix/code-quality-improvements
2 parents fb4dbf1 + 935029c commit 402a1e2

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

CMakeLists.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
cmake_minimum_required(VERSION 3.12)
22

3+
# Set CMake policies to handle compatibility with older dependencies
4+
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.27")
5+
cmake_policy(SET CMP0144 NEW)
6+
endif()
7+
8+
# Set policy to handle older CMake requirements in dependencies
9+
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.5")
10+
cmake_policy(SET CMP0000 NEW)
11+
endif()
12+
313
if (PACKAGE_MANAGER)
414
if(NOT PACKAGE_MANAGER MATCHES "^(hunter|vcpkg)$")
515
message(FATAL_ERROR "PACKAGE_MANAGER must be set to 'hunter', 'vcpkg' or isn't set")
@@ -16,10 +26,6 @@ else ()
1626
endif ()
1727
message(STATUS "Selected package manager: ${PACKAGE_MANAGER}")
1828

19-
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.27")
20-
cmake_policy(SET CMP0144 NEW)
21-
endif()
22-
2329
find_program(CCACHE_FOUND ccache)
2430
if (CCACHE_FOUND)
2531
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)

cmake/Hunter/config.cmake

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,44 @@
1515
# CMAKE_ARGS "CMAKE_VARIABLE=value"
1616
# )
1717

18+
# Fix for Protobuf CMake compatibility issue with modern CMake versions
19+
hunter_config(
20+
Protobuf
21+
VERSION 3.19.4-p0
22+
CMAKE_ARGS
23+
CMAKE_POLICY_VERSION_MINIMUM=3.5
24+
protobuf_BUILD_TESTS=OFF
25+
protobuf_BUILD_SHARED_LIBS=OFF
26+
KEEP_PACKAGE_SOURCES
27+
)
28+
29+
# Fix for c-ares CMake compatibility issue with modern CMake versions
30+
hunter_config(
31+
c-ares
32+
VERSION 1.14.0-p0
33+
CMAKE_ARGS
34+
CMAKE_POLICY_VERSION_MINIMUM=3.5
35+
KEEP_PACKAGE_SOURCES
36+
)
37+
38+
# Fix for yaml-cpp CMake compatibility issue with modern CMake versions
39+
hunter_config(
40+
yaml-cpp
41+
VERSION 0.6.2-0f9a586-p1
42+
CMAKE_ARGS
43+
CMAKE_POLICY_VERSION_MINIMUM=3.5
44+
KEEP_PACKAGE_SOURCES
45+
)
46+
47+
# Fix for Boost.DI CMake compatibility issue with modern CMake versions
48+
hunter_config(
49+
Boost.DI
50+
VERSION 1.1.0-p1
51+
CMAKE_ARGS
52+
CMAKE_POLICY_VERSION_MINIMUM=3.5
53+
KEEP_PACKAGE_SOURCES
54+
)
55+
1856
hunter_config(
1957
soralog
2058
VERSION 0.2.5

0 commit comments

Comments
 (0)