本文共 1738 字,大约阅读时间需要 5 分钟。
1. 下载 cmake 源文件 ,选择linux 版本
2. 在docker linux 下 ,cd 进入文件夹 如:
cmake-3.19.8
执行文件
./bootstrap
make all -j8
sudo make install
编译完成:
-- Installing: /usr/local/share/cmake-3.19/Templates/Windows/SmallLogo44x44.png-- Installing: /usr/local/share/cmake-3.19/Templates/Windows/Windows_TemporaryKey.pfx-- Installing: /usr/local/share/cmake-3.19/Templates/Windows/Logo.png-- Installing: /usr/local/share/cmake-3.19/Templates/Windows/SmallLogo.png-- Installing: /usr/local/share/cmake-3.19/Templates/Windows/StoreLogo.png-- Installing: /usr/local/share/cmake-3.19/Templates/Windows/ApplicationIcon.png-- Installing: /usr/local/share/vim/vimfiles/indent-- Installing: /usr/local/share/vim/vimfiles/indent/cmake.vim-- Installing: /usr/local/share/vim/vimfiles/syntax-- Installing: /usr/local/share/vim/vimfiles/syntax/cmake.vim-- Installing: /usr/local/share/emacs/site-lisp/cmake-mode.el-- Installing: /usr/local/share/aclocal/cmake.m4-- Installing: /usr/local/share/bash-completion/completions/cmake-- Installing: /usr/local/share/bash-completion/completions/cpack-- Installing: /usr/local/share/bash-completion/completions/ctestroot@6f3e3db63505:/home/l1/cmake-3.19.8# cmake --versionCMake Error: Could not find CMAKE_ROOT !!!CMake has most likely not been installed correctly.Modules directory not found in/usr/local/share/cmake-3.10cmake version 3.10.2CMake suite maintained and supported by Kitware (kitware.com/cmake)
可以看到 此时 是报出错误的:
CMake Error: Could not find CMAKE_ROOT !!!CMake has most likely not been installed correctly.
执行 命令:
hash -r
可以看出结果:
root@6f3e3db63505:/home/l1/cmake-3.19.8# cmake --versioncmake version 3.19.8CMake suite maintained and supported by Kitware (kitware.com/cmake).root@6f3e3db63505:/home/l1/cmake-3.19.8# ls
显示版本正常。
转载地址:http://fkczb.baihongyu.com/