Skip to content

Commit 3cad2e1

Browse files
authored
Update FetchContent_Populate -> FetchContent_MakeAvailable in googletest.cmake (#6953)
To fix: ```bash CMake Warning (dev) at /home/runner/.local/lib/python3.10/site-packages/cmake/data/share/cmake-3.31/Modules/FetchContent.cmake:1953 (message): Calling FetchContent_Populate(googletest) is deprecated, call FetchContent_MakeAvailable(googletest) instead. Policy CMP0169 can be set to OLD to allow FetchContent_Populate(googletest) to be called directly for now, but the ability to call it with declared details will be removed completely in a future version. Call Stack (most recent call first): unittest/googletest.cmake:18 (FetchContent_Populate) cmake/AddTritonUnitTest.cmake:1 (include) CMakeLists.txt:81 (include) ```
1 parent 766f7fa commit 3cad2e1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

unittest/googletest.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ FetchContent_Declare(
1515
FetchContent_GetProperties(googletest)
1616

1717
if(NOT googletest_POPULATED)
18-
FetchContent_Populate(googletest)
18+
FetchContent_MakeAvailable(googletest)
1919
if (MSVC)
2020
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
2121
endif()
22-
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
2322
endif()

0 commit comments

Comments
 (0)