相关文章推荐
叛逆的脸盆  ·  SQL Server ...·  4 月前    · 
重感情的草稿本  ·  博士申请 | ...·  8 月前    · 
沉着的跑步鞋  ·  配置React Native ...·  8 月前    · 
热心的鼠标垫  ·  spring MVC ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm been working with CLion when I would update his cmake version to use my default cmake binary, so : " /usr/bin/cmake ".

When I entered cmake's path, there is two binaries matching the expression : " /usr/bin/cmake " and " /usr/bin/cmake3 ". It puzzled me with some questions.

What's the difference between that two and which one to use ?

Try this: /usr/bin/cmake --version and /usr/bin/cmake3 --version and see whether the result yields any insights. lubgr Jun 22, 2018 at 14:19 You can try ls -la /usr/bin/cmake* . In my case I can see /usr/bin/cmake -> /usr/bin/cmake3 . That means that cmake is a symbolic link to cmake3. Both are same. Thomas Sablik Jun 22, 2018 at 14:21 Thank you @ThomasSablik, I didn' think to try using ls , thank you for this quick response! Sunchock Jun 22, 2018 at 15:21

As Thomas Sablik mentioned, /usr/bin/cmake is simply a symbolic link to /usr/bin/cmake3 . This is the practice of many binaries in Linux - having a symbolic link to a specific version of a binary. In many cases, multiple binaries are installed simultaneously. When/If CMake 4 is released, presumably it will be placed in /usr/bin/cmake4 , and the symbolic link updated by the installation.

However, cmake actually goes a step further in its versioning, because in your CMakeLists.txt, you must use the cmake_minimum_required statements, ensuring that your script will not run, unless it is run with a compatible version.

cmake is not necessarily a symbolic link. For example on Centos 6 and 7 cmake and cmake3 are different binaries. f3xy Aug 27, 2019 at 21:54

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .