安装完后,执行cmake --version会报如下错误

本文详细介绍了在安装CMake后遇到“Could not find CMAKE_ROOT”错误的解决方案。通过执行命令'hash -r'和重新运行'cmake --version',可以成功解决此问题。

【注】安装完后,执行cmake --version会报如下错误

 

CMake Error: Could not find CMAKE_ROOT !!!

CMake has most likely not been installed correctly.

Modules directory not found in

/Applications/CMake 2.8-11.app/Contents/bin

CMake Error: Error executing cmake::LoadCache(). Aborting.

 

【解决方法】

 

先执行:

hash -r

 

然后再执行:cmake --version

 

完美解决

CMake Deprecation Warning at CMakeLists.txt:25 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. CMake Deprecation Warning at third_party/abseil-cpp/CMakeLists.txt:22 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. CMake Deprecation Warning at third_party/cares/cares/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. CMake Deprecation Warning at third_party/protobuf/cmake/CMakeLists.txt:2 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. 3.12.3.0 CMake Warning (dev) at cmake/re2.cmake:31 (install): Target re2 has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION. Call Stack (most recent call first): CMakeLists.txt:237 (include) This warning is for project developers. Use -Wno-dev to suppress it. CMake Deprecation Warning at third_party/boringssl-with-bazel/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. CMake Error at E:/CMake/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message): Could NOT find Perl (missing: PERL_EXECUTABLE) Call Stack (most recent call first): E:/CMake/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE) E:/CMake/share/cmake-3.31/Modules/FindPerl.cmake:89 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) third_party/boringssl-with-bazel/CMakeLists.txt:32 (find_package) Configuring incomplete, errors occurred!
最新发布
07-08
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值