CMake版本更新 [英] Cmake version update

查看:104
本文介绍了CMake版本更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 我正在尝试在Linux机器上安装Cmake的较新版本(2.8.11)。已经安装的版本是2.8.6。现在,我使用 cmake 命令在单独的 mycmakebuild 文件夹中构建了较新的版本。然后我运行 make 命令。根据cmake网站,如果我从构建文件夹中运行 cmake * mycmakebuild * ,则 make install 命令是可选的。这意味着在运行 cmake make 命令之后,我不需要运行 make install 。但是,当我使用 cmake --version 检查 mycmakebuild 文件夹中cmake的版本时,它仍然显示较旧的版本。 (我没有管理员权限来运行 make install 命令)。请提出可能出了什么问题。

  1. I am using trying to install a newer version (2.8.11) of Cmake on my linux machine. The version already installed is 2.8.6. Now I build the newer version with cmake command in a separate mycmakebuild folder. then i run make command. according to the cmake website, if i run cmake from my build folder*mycmakebuild* , make install command is optional. Which means after running cmake and make commands, i do not need to run make install. But when I check the version of cmake in mycmakebuild folder using cmake --version, it still shows the older version. (I do not have admin privilege to run make install command). please suggest what could be wrong.

如果我想在 mycmakebuild 文件夹之外运行cmake命令怎么办?它仍然运行旧版本。如何为它提供从更新版本运行cmake的路径。

What if I want to run cmake command outside of mycmakebuild folder? It still runs the older version. How to give it the path to run cmake from the updated version.


推荐答案

听起来很像您只是将新建的可执行文件称为错误道。将目录更改为执行文件所在的位置后,可以使用

It sounds very much like you just call the newly built executable the wrong way. After you change directory to where the executalbe is, you call it with

./cmake

而不是仅

cmake

第一个调用当前目录中的可执行文件,后者在系统搜索路径中找到($ PATH) )。

The first calls the executable inside the current directory, the latter the one found in the systems search path ($PATH).

如果您想从其他地方调用cmake版本,只需在其路径前加一条路径,例如

If you like to call your cmake-Version from anotherplace, just prepend the path to it, something like

mycmakebuild/src/cmake

至于进行安装:您可以执行此操作,只需调整文件应放置的路径即可。如果您在构建目录中运行 make edit_cache ,则可以将 CMAKE_INSTALL_PREFIX 设置为/ home / yourlogin / cmake和cmake将安装到该位置。使用此功能,您还可以摆脱构建目录中的许多(无用的)目标文件。

As for the make install: you can do it, you just have to adjust the path to where the files should go. If you run make edit_cache inside your build-directory, you can set the CMAKE_INSTALL_PREFIX to e.g. /home/yourlogin/cmake and cmake will install to that location. Using this, you can also get rid of the many (useless) object files inside the build directory.

这篇关于CMake版本更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆