gpt4 book ai didi

c++ - CMake错误:CMake无法找到与 “Unix Makefiles”相对应的生成程序。未设置CMAKE_MAKE_PROGRAM

转载 作者:行者123 更新时间:2023-12-02 10:38:10 36 4
gpt4 key购买 nike

我正在使用linaro-aarch64-2018.05在Windows 10 x64上交叉编译以创建环境,c++ 11
cmake版本3.1.6
当我生成文件时

set GENMAKE_DIR=genmake-cv22-win-Linaro-aarch64
set VERSION=cv22-win-Linaro-aarch64
set CROSSMAKETOOL=cs-make-2013.11-33.exe

..\genmake-tools-win32\genMakefiles-win32.bat


工具链文件
##--- target system
set(CMAKE_SYSTEM_NAME Linux) #--- Name of the OS CMake is building for. (uname -s)
set(CMAKE_SYSTEM_VERSION 4.9.0) #--- OS version CMake is building for. (uname -r)
set(CMAKE_SYSTEM_PROCESSOR unknown) #--- The name of the CPU CMake is building for. (uname -p)

##--- crosstool path
set(CROSSTOOL_DIR c:/arm-linux/linaro-aarch64-2018.05)
set(CROSSTOOL_NAME aarch64-linux-gnu)
set(CROSSTOOL_VER 7.1.1)
#set(OS_DIR d:/s2-sdk/ambarella/kernel/linux)

##--- crosstool compiler
set(CMAKE_C_COMPILER ${CROSSTOOL_DIR}/bin/${CROSSTOOL_NAME}-gcc.exe)
set(CMAKE_CXX_COMPILER ${CROSSTOOL_DIR}/bin/${CROSSTOOL_NAME}-g++.exe)

#--- where is the target environment.
set(CMAKE_FIND_ROOT_PATH ${CROSSTOOL_DIR})

##--- search for programs in the build host directories.
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
#--- for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRATY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

当我在Windows 7下运行时一切都很好,但是当我更改为Windows 10时
错误出现
日志:
D:\Project\frdatabase\genmake-cv22-win-Linaro-aarch64>copy ..\genmake-tools-win32\make-console.bat     ..\build
copy an file

D:\Project\frdatabase\genmake-cv22-win-Linaro-aarch64>copy ..\genmake-tools-win32\sh.exe
..\build\
copy an file

D:\Project\frdatabase\genmake-cv22-win-Linaro-aarch64>copy ..\genmake-tools-win32\cs-make-2013.11-33.exe ..\build\make.exe
copy an file

D:\Project\frdatabase\genmake-cv22-win-Linaro-aarch64>cd ..\build

D:\Project\frdatabase\build>cmake -DCMAKE_TOOLCHAIN_FILE=toolchain-cv22-win-Linaro-aarch64.cmake -G"Unix Makefiles" ../trunk
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
See also "D:/Project/frdatabase/build/CMakeFiles/CMakeOutput.log".

D:\Project\frdatabase\build>cd ..\genmake-cv22-win-Linaro-aarch64

D:\Project\frdatabase\genmake-cv22-win-Linaro-aarch64>pause

CmakeOutput:
The target system is: Linux - 4.9.0 - unknown
The host system is: Windows - 10.0.18362 - AMD64

互联网上有很多类似的错误,但是所有这些错误都使用了不正确的品牌,但是我很确定自己使用的是正确的,因为我也是从Windows 10以下的同事那里得到的。

最佳答案

问题是关于cmake的版本
3.16.0存在此问题,但可以在3.10.3下构建。

关于c++ - CMake错误:CMake无法找到与 “Unix Makefiles”相对应的生成程序。未设置CMAKE_MAKE_PROGRAM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59099924/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com