shinchiro/mpv-winbuild-cmake

build error

Closed this issue · 2 comments

console:

PS F:\github\mpv-winbuild-cmake> cd .\build64
PS F:\github\mpv-winbuild-cmake\build64> cmake -DTARGET_ARCH=x86_64-w64-mingw32 -G Ninja ..
-- The C compiler identification is GNU 8.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
tar: could not chdir to 'F:/github/mpv-winbuild-cmake/build64/cmake'

CMake Error at cmake/download_externalproject.cmake:28 (include):
include could not find requested file:

F:/github/mpv-winbuild-cmake/build64/cmake/Modules/ExternalProject.cmake

Call Stack (most recent call first):
CMakeLists.txt:4 (include)

CMake Error at toolchain/binutils.cmake:1 (ExternalProject_Add):
Unknown CMake command "ExternalProject_Add".
Call Stack (most recent call first):
toolchain/CMakeLists.txt:17 (include)

-- Configuring incomplete, errors occurred!
See also "F:/github/mpv-winbuild-cmake/build64/CMakeFiles/CMakeOutput.log".
PS F:\github\mpv-winbuild-cmake\build64> cmake -DTARGET_ARCH=x86_64-w64-mingw32 -G Ninja ..
CMake Error at cmake/download_externalproject.cmake:28 (include):
include could not find requested file:

F:/github/mpv-winbuild-cmake/build64/cmake/Modules/ExternalProject.cmake

Call Stack (most recent call first):
CMakeLists.txt:4 (include)

CMake Error at toolchain/binutils.cmake:1 (ExternalProject_Add):
Unknown CMake command "ExternalProject_Add".
Call Stack (most recent call first):
toolchain/CMakeLists.txt:17 (include)

-- Configuring incomplete, errors occurred!
See also "F:/github/mpv-winbuild-cmake/build64/CMakeFiles/CMakeOutput.log".
PS F:\github\mpv-winbuild-cmake\build64> cmake -DTARGET_ARCH=x86_64-w64-mingw32 -G Ninja ..
CMake Error at build64/cmake/Modules/ExternalProject/shared_internal_commands.cmake:1 (cmake_policy):
An attempt was made to set the policy version of CMake to "3.25" which is
greater than this version of CMake. This is not allowed because the
greater version may have new policies not known to this CMake. You may
need a newer CMake version to build this project.
Call Stack (most recent call first):
build64/cmake/Modules/ExternalProject.cmake:1213 (include)
cmake/download_externalproject.cmake:28 (include)
CMakeLists.txt:4 (include)

CMake Error at build64/cmake/Modules/ExternalProject.cmake:4292 (cmake_policy):
cmake_policy GET given policy "CMP0150" which is not known to this version
of CMake.
Call Stack (most recent call first):
toolchain/binutils.cmake:1 (ExternalProject_Add)
toolchain/CMakeLists.txt:17 (include)

CMake Error at build64/toolchain/mingw-w64-prefix/tmp/mingw-w64-mkdirs.cmake:6 (file):
file problem creating directory:
F:/github/mpv-winbuild-cmake/build64/toolchain/GIT_CLONE_FLAGS;--filter=tree:0
Call Stack (most recent call first):
build64/cmake/Modules/ExternalProject.cmake:1744 (include)
build64/cmake/Modules/ExternalProject.cmake:4277 (_ep_set_directories)
toolchain/mingw-w64.cmake:1 (ExternalProject_Add)
toolchain/CMakeLists.txt:17 (include)

CMake Error at build64/cmake/Modules/ExternalProject.cmake:4292 (cmake_policy):
cmake_policy GET given policy "CMP0150" which is not known to this version
of CMake.
Call Stack (most recent call first):
toolchain/mingw-w64.cmake:1 (ExternalProject_Add)
toolchain/CMakeLists.txt:17 (include)

CMake Error at cmake/custom_steps.cmake:129 (if):
if given arguments:

"EXISTS" "F:/github/mpv-winbuild-cmake/build64/toolchain/GIT_CLONE_FLAGS" "--filter=tree:0/.git"

Unknown arguments specified
Call Stack (most recent call first):
toolchain/mingw-w64.cmake:12 (force_rebuild_git)
toolchain/CMakeLists.txt:17 (include)

-- Configuring incomplete, errors occurred!
See also "F:/github/mpv-winbuild-cmake/build64/CMakeFiles/CMakeOutput.log".
PS F:\github\mpv-winbuild-cmake\build64>

log
CMakeOutput.log

Someone put files for v3.27 in the release folder while current release is still 3.26.4.

Manually replacing with files in the 3.26.4 worked

https://gitlab.kitware.com/cmake/cmake/-/archive/release/cmake-release.tar.gz

cmake-3.26.4-linux-x86_64\share\cmake-3.26\Modules\

Patch for using cmake v3.26.4:

From d17cd1e9d6ea52f52c7f8734b0a279b16e6894ce Mon Sep 17 00:00:00 2001
From: zhongfly <11155705+zhongfly@users.noreply.github.com>
Date: Sun, 11 Jun 2023 14:16:17 +0800
Subject: [PATCH] cmake: temporary fix cmake error for v3.26.4

---
 cmake/download_externalproject.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/download_externalproject.cmake b/cmake/download_externalproject.cmake
index c67a8cb..9966936 100644
--- a/cmake/download_externalproject.cmake
+++ b/cmake/download_externalproject.cmake
@@ -16,7 +16,7 @@ endif()
 
 if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/cmake/Modules/ExternalProject.cmake")
     execute_process(
-        COMMAND curl -sLO https://gitlab.kitware.com/cmake/cmake/-/raw/release/Modules/ExternalProject.cmake
+        COMMAND curl -sLO https://gitlab.kitware.com/cmake/cmake/-/raw/v3.26.4/Modules/ExternalProject.cmake
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cmake/Modules
     )
     execute_process(
-- 
2.40.1