From 07a372e994e09f5ad18d2963f2abc19b273cd4a1 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 23 Aug 2024 16:21:05 +0200 Subject: [PATCH] build: move googletest to FetchContent_MakeAvailable --- TODO | 2 +- test/CMakeLists.txt | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index c1bbf282b..866ac7dd2 100644 --- a/TODO +++ b/TODO @@ -38,7 +38,7 @@ TODO: * exploit ref/cref in any to avoid invoking the vtable if possible * entity based component_traits * copy-and-swap for any and meta_any -* fix cmake warning about FetchContent_Populate +* review cmake warning about FetchContent_Populate (need .28 and EXCLUDE_FROM_ALL for FetchContent) * deprecate meta properties in favor of custom data * make meta objects safe to use with null nodes * meta: vectors for details and props diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0fba5adb2..5102c9371 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,13 +16,8 @@ else() GIT_SHALLOW 1 ) - FetchContent_GetProperties(googletest) - - if(NOT googletest_POPULATED) - FetchContent_Populate(googletest) - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}) - endif() + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + FetchContent_MakeAvailable(googletest) add_library(GTest::Main ALIAS gtest_main)