• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[zstd] Build error on x64-windows with VS2022 and Ninja: CMake policy version error persists

spyfox

New Member
Joined
Feb 20, 2025
Messages
1
Reaction score
0
GitHub
caioblumer
Issue Description:

I'm encountering a persistent build error while installing zstd:x64-windows via vcpkg. The error occurs during the configuration stage using Ninja, with CMake complaining about an outdated minimum required version. Despite several attempts to force a minimum CMake policy of 3.5, the error remains.

Error Message:

Console

Bash:
error: building zstd:x64-windows failed with: BUILD_FAILED
See https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.
Elapsed time to handle zstd:x64-windows: 672 ms
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
  https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+zstd
You can submit a new issue at:
  https://github.com/microsoft/vcpkg/issues/new?title=[zstd]+Build+error+on+x64-windows&body=Copy%20issue%20body%20from%20G%3A%2Fforgottenserver%2Fbuild%2Fvcpkg_installed%2Fvcpkg%2Fissue_body.md

-- Running vcpkg install - failed
CMake Error at G:/vcpkg/scripts/buildsystems/vcpkg.cmake:904 (message):
  vcpkg install failed.  See logs for more information:
  G:\forgottenserver\build\vcpkg-manifest-install.log
Call Stack (most recent call first):
  G:/Program Files/CMake/share/cmake-4.0/Modules/CMakeDetermineSystem.cmake:146 (include)
  CMakeLists.txt:34 (project)


-- Configuring incomplete, errors occurred!

config-x64-windows-out.log


Bash:
[1/2] "G:/Program Files/CMake/bin/cmake.exe" -E chdir "../../x64-windows-dbg" "G:/Program Files/CMake/bin/cmake.exe" "G:/vcpkg/buildtrees/zstd/src/v1.5.5-b23e615f5d.clean/build/cmake" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=G:/vcpkg/packages/zstd_x64-windows/debug" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DZSTD_BUILD_SHARED=1" "-DZSTD_BUILD_STATIC=0" "-DZSTD_LEGACY_SUPPORT=1" "-DZSTD_BUILD_TESTS=0" "-DZSTD_BUILD_CONTRIB=0" "-DZSTD_MULTITHREAD_SUPPORT=1" "-DCMAKE_MAKE_PROGRAM=G:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=G:/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v143" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=G:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=G:/vcpkg" "-D_VCPKG_INSTALLED_DIR=G:/forgottenserver/build/vcpkg_installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DZSTD_BUILD_PROGRAMS=OFF"
FAILED: ../../x64-windows-dbg/CMakeCache.txt
"G:/Program Files/CMake/bin/cmake.exe" -E chdir "../../x64-windows-dbg" "G:/Program Files/CMake/bin/cmake.exe" "G:/vcpkg/buildtrees/zstd/src/v1.5.5-b23e615f5d.clean/build/cmake" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=G:/vcpkg/packages/zstd_x64-windows/debug" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DZSTD_BUILD_SHARED=1" "-DZSTD_BUILD_STATIC=0" "-DZSTD_LEGACY_SUPPORT=1" "-DZSTD_BUILD_TESTS=0" "-DZSTD_BUILD_CONTRIB=0" "-DZSTD_MULTITHREAD_SUPPORT=1" "-DCMAKE_MAKE_PROGRAM=G:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=G:/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v143" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=G:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=G:/vcpkg" "-D_VCPKG_INSTALLED_DIR=G:/forgottenserver/build/vcpkg_installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DZSTD_BUILD_PROGRAMS=OFF"
CMake Error at CMakeLists.txt:10 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.


-- Configuring incomplete, errors occurred!
[2/2] "G:/Program Files/CMake/bin/cmake.exe" -E chdir ".." "G:/Program Files/CMake/bin/cmake.exe" "G:/vcpkg/buildtrees/zstd/src/v1.5.5-b23e615f5d.clean/build/cmake" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=G:/vcpkg/packages/zstd_x64-windows" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DZSTD_BUILD_SHARED=1" "-DZSTD_BUILD_STATIC=0" "-DZSTD_LEGACY_SUPPORT=1" "-DZSTD_BUILD_TESTS=0" "-DZSTD_BUILD_CONTRIB=0" "-DZSTD_MULTITHREAD_SUPPORT=1" "-DCMAKE_MAKE_PROGRAM=G:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=G:/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v143" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=G:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=G:/vcpkg" "-D_VCPKG_INSTALLED_DIR=G:/forgottenserver/build/vcpkg_installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DZSTD_BUILD_PROGRAMS=0"
FAILED: ../CMakeCache.txt
"G:/Program Files/CMake/bin/cmake.exe" -E chdir ".." "G:/Program Files/CMake/bin/cmake.exe" "G:/vcpkg/buildtrees/zstd/src/v1.5.5-b23e615f5d.clean/build/cmake" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=G:/vcpkg/packages/zstd_x64-windows" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DZSTD_BUILD_SHARED=1" "-DZSTD_BUILD_STATIC=0" "-DZSTD_LEGACY_SUPPORT=1" "-DZSTD_BUILD_TESTS=0" "-DZSTD_BUILD_CONTRIB=0" "-DZSTD_MULTITHREAD_SUPPORT=1" "-DCMAKE_MAKE_PROGRAM=G:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=G:/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v143" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=G:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=G:/vcpkg" "-D_VCPKG_INSTALLED_DIR=G:/forgottenserver/build/vcpkg_installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DZSTD_BUILD_PROGRAMS=0"
CMake Error at CMakeLists.txt:10 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.


-- Configuring incomplete, errors occurred!
ninja: build stopped: subcommand failed.

Environment Details:

  • OS: Windows 10
  • Visual Studio: 2022 Community (MSVC 14.43.34808)
  • CMake: (Installed from "G:/Program Files/CMake/bin/cmake.exe")
  • Ninja: 1.12.1
  • vcpkg: Latest version (updated via git pull)
Steps Taken:

  1. Set Extra CMake Flag via Environment Variable:
    powershell
    Bash:
    $env:VCPKG_CMAKE_ARGS="-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
    .\vcpkg install zstd:x64-windows
  2. Modified the zstd Portfile:
    Edited G:\vcpkg\ports\zstd\portfile.cmake to add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 in the vcpkg_cmake_configure call.
  3. Forced Visual Studio Generator:
    Set the environment variable:
    powershell
    Bash:
    $env:VCPKG_CMAKE_GENERATOR="Visual Studio 17 2022"
    and re-ran the install.
  4. Cleared Cached Build Trees:
    Deleted G:\vcpkg\buildtrees\zstd to force a fresh configuration.
  5. Manually Patched CMakeLists.txt:
    Edited the CMakeLists.txt in the zstd source (G:\vcpkg\buildtrees\zstd\src\v1.5.5-b23e615f5d.clean\build\cmake\CMakeLists.txt) to update the cmake_minimum_required version to 3.5.
Despite these efforts, the build still fails with the same error.

Request:

Could you please advise on any additional workarounds or provide guidance on how to resolve this CMake configuration issue with zstd on x64-windows using Ninja? Any help would be greatly appreciated.

Thank you!
 
Solution
You're probably using version 4.0.0-rc1 of CMake by mistake.

Try running the following on your command line:
Bash:
cmake --version

Make sure you're using the LTS version of CMake instead - v3.31.5.
You're probably using version 4.0.0-rc1 of CMake by mistake.

Try running the following on your command line:
Bash:
cmake --version

Make sure you're using the LTS version of CMake instead - v3.31.5.
 
Solution
Back
Top