summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2022-08-21 10:03:32 -0700
committerHans Kristian Rosbach <hk-github@circlestorm.org>2022-09-05 11:24:50 +0200
commitab47c738037dc51d0d44de7e64661648c24c9fb4 (patch)
treeb1021fa808a000c8342d83f3e5b4bf6c1b425744 /test
parent89763032d57e3da5301f4cd6e1f363e7a1f85f02 (diff)
downloadProject-Tick-ab47c738037dc51d0d44de7e64661648c24c9fb4.tar.gz
Project-Tick-ab47c738037dc51d0d44de7e64661648c24c9fb4.zip
Fixed content already populated error in CMake scripts. #1327
Should only need to use either FetchContent_MakeAvailable or FetchContent_GetProperties and FetchContent_Populate but not both methods. We use the later for CMake compatibility with lower versions.
Diffstat (limited to 'test')
-rw-r--r--test/benchmarks/CMakeLists.txt10
-rw-r--r--test/pigz/CMakeLists.txt3
2 files changed, 6 insertions, 7 deletions
diff --git a/test/benchmarks/CMakeLists.txt b/test/benchmarks/CMakeLists.txt
index 19762fc738..e6eaa352b0 100644
--- a/test/benchmarks/CMakeLists.txt
+++ b/test/benchmarks/CMakeLists.txt
@@ -14,11 +14,11 @@ if(NOT benchmark_FOUND)
set(BENCHMARK_ENABLE_TESTING OFF)
FetchContent_Declare(benchmark
GIT_REPOSITORY https://github.com/google/benchmark.git)
- FetchContent_MakeAvailable(benchmark)
- FetchContent_GetProperties(benchmark)
+ FetchContent_GetProperties(benchmark)
if(NOT benchmark_POPULATED)
FetchContent_Populate(benchmark)
+ add_subdirectory(${benchmark_SOURCE_DIR} ${benchmark_BINARY_DIR})
endif()
endif()
@@ -55,15 +55,15 @@ if(WITH_BENCHMARK_APPS)
if(NOT PNG_FOUND)
FetchContent_Declare(PNG
GIT_REPOSITORY https://github.com/glennrp/libpng.git)
- FetchContent_MakeAvailable(PNG)
- FetchContent_GetProperties(PNG)
+ FetchContent_GetProperties(PNG)
if(NOT PNG_POPULATED)
FetchContent_Populate(PNG)
+ add_subdirectory(${PNG_SOURCE_DIR} ${PNG_BINARY_DIR})
endif()
endif()
- set(BENCH_APP_SRCS
+ set(BENCH_APP_SRCS
benchmark_png_encode.cc
benchmark_png_decode.cc
benchmark_main.cc
diff --git a/test/pigz/CMakeLists.txt b/test/pigz/CMakeLists.txt
index d1f5b22d23..bc6830ae24 100644
--- a/test/pigz/CMakeLists.txt
+++ b/test/pigz/CMakeLists.txt
@@ -64,9 +64,8 @@ endif()
FetchContent_Declare(pigz
GIT_REPOSITORY https://github.com/madler/pigz.git
GIT_TAG ${PIGZ_TAG})
-FetchContent_MakeAvailable(pigz)
-FetchContent_GetProperties(pigz)
+FetchContent_GetProperties(pigz)
if(NOT pigz_POPULATED)
FetchContent_Populate(pigz)
endif()