With CMake 3.17.5 on CentOS7:
-- Downloading Zstd from the internet since Zstd>=1.3.4 was not found locally and DEPS=AUTO
CMake Error at cmake/FindZstd.cmake:60 (set_target_properties):
set_target_properties Can not find target to add properties to:
libzstd_static
Call Stack (most recent call first):
cmake/Dependencies.cmake:29 (find_package)
CMakeLists.txt:88 (include)
CMake Error at cmake/FindZstd.cmake:68 (add_library):
add_library cannot create ALIAS target "dep_zstd" because target
"libzstd_static" does not already exist.
Call Stack (most recent call first):
cmake/Dependencies.cmake:29 (find_package)
CMakeLists.txt:88 (include)
SOURCE_SUBDIR build/cmake
${_zstd_patch}
)
- FetchContent_MakeAvailable(Zstd)
+
+ # When it works: Use FetchContent_MakeAvailable(Zstd) instead
+ FetchContent_GetProperties(zstd)
+ if(NOT zstd_POPULATED)
+ FetchContent_Populate(Zstd)
+ add_subdirectory("${zstd_SOURCE_DIR}/build/cmake" "${zstd_BINARY_DIR}" EXCLUDE_FROM_ALL)
+ endif()
# Workaround until https://github.com/facebook/zstd/pull/3968 is included in a
# release: