Browse Source

build: move googletest to FetchContent_MakeAvailable

Michele Caini 1 năm trước cách đây
mục cha
commit
07a372e994
2 tập tin đã thay đổi với 3 bổ sung8 xóa
  1. 1 1
      TODO
  2. 2 7
      test/CMakeLists.txt

+ 1 - 1
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

+ 2 - 7
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)