Skip to content

Commit 9f893c3

Browse files
Copilotwysaid
andcommitted
Fix CMake policy version minimum issue for GoogleTest compatibility
Set CMAKE_POLICY_VERSION_MINIMUM=3.5 when not already defined to prevent CMake compatibility errors when fetching GoogleTest dependencies. This resolves the build failure that occurs with newer CMake versions. Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
1 parent fc1b10a commit 9f893c3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
cmake_minimum_required(VERSION 3.14)
22

3+
# Set CMAKE_POLICY_VERSION_MINIMUM if not already defined to avoid compatibility issues
4+
# with newer CMake versions when fetching dependencies like GoogleTest
5+
if(NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM)
6+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
7+
endif()
8+
39
option(CCAP_NO_LOG "Disable logging" OFF)
410

511
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)

0 commit comments

Comments
 (0)