更新CMake配置,替换GoogleTest的FetchContent集成为find_package调用
This commit is contained in:
@@ -1,17 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
# ========================================
|
||||
# GoogleTest 集成
|
||||
# ========================================
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG v1.14.0
|
||||
)
|
||||
# Windows 兼容性设置
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
FetchContent_MakeAvailable(googletest)
|
||||
find_package(gtest CONFIG REQUIRED)
|
||||
|
||||
# 启用测试
|
||||
enable_testing()
|
||||
|
||||
Reference in New Issue
Block a user