Linux安装cmake指定版本
2019-07-05 本文已影响33人
Jerry_1116
1 .sh
wizard安装
1.1 下载
到CMake官网下载安装的.sh文件cmake-3.14.5-Linux-x86_64.sh。
1.2 安装
# mkdir /usr/devs/cmake
# mv cmake-3.14.5-Linux-x86_64.sh /usr/devs/cmake
# cd /usr/devs/cmake
# bash cmake-3.14.5-Linux-x86_64.sh
CMake Installer Version: 3.14.5, Copyright (c) Kitware
This is a self-extracting archive.
The archive will be extracted to: /usr/devs/cmake
If you want to stop extracting, please press <ctrl-C>.
CMake - Cross Platform Makefile Generator
Copyright 2000-2019 Kitware, Inc. and Contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Kitware, Inc. nor the names of Contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
The following individuals and institutions are among the Contributors:
* Aaron C. Meadows <cmake@shadowguarddev.com>
* Adriaan de Groot <groot@kde.org>
* Aleksey Avdeev <solo@altlinux.ru>
* Alexander Neundorf <neundorf@kde.org>
* Alexander Smorkalov <alexander.smorkalov@itseez.com>
* Alexey Sokolov <sokolov@google.com>
* Alex Merry <alex.merry@kde.org>
* Alex Turbov <i.zaufi@gmail.com>
* Andreas Pakulat <apaku@gmx.de>
* Andreas Schneider <asn@cryptomilk.org>
* André Rigland Brodtkorb <Andre.Brodtkorb@ifi.uio.no>
* Axel Huebl, Helmholtz-Zentrum Dresden - Rossendorf
* Benjamin Eikel
* Bjoern Ricks <bjoern.ricks@gmail.com>
* Brad Hards <bradh@kde.org>
* Christopher Harvey
* Christoph Grüninger <foss@grueninger.de>
* Clement Creusot <creusot@cs.york.ac.uk>
* Daniel Blezek <blezek@gmail.com>
Do you accept the license? [yN]:
y
By default the CMake will be installed in:
"/usr/devs/cmake/cmake-3.14.5-Linux-x86_64"
Do you want to include the subdirectory cmake-3.14.5-Linux-x86_64?
Saying no will install in: "/usr/devs/cmake" [Yn]:
n
Using target directory: /usr/devs/cmake
Extracting, please wait...
Unpacking finished successfully
# cmake -v
-bash: /usr/bin/cmake: No such file or directory
1.3 配置
由于没有配置全局或者用户shell,因此无法直接执行,需要进行配置。
# ln -sf $(pwd)/bin/* /usr/bin/
# ll /usr/bin/ | grep cmak
lrwxrwxrwx 1 root root 26 Jul 5 16:55 ccmake -> /usr/devs/cmake/bin/ccmake*
lrwxrwxrwx 1 root root 25 Jul 5 16:55 cmake -> /usr/devs/cmake/bin/cmake*
lrwxrwxrwx 1 root root 29 Jul 5 16:55 cmake-gui -> /usr/devs/cmake/bin/cmake-gui*
lrwxrwxrwx 1 root root 25 Jul 5 16:55 cpack -> /usr/devs/cmake/bin/cpack*
lrwxrwxrwx 1 root root 25 Jul 5 16:55 ctest -> /usr/devs/cmake/bin/ctest*
# cmake --version
cmake version 3.14.5
至此,安装完毕。