Understanding the Purpose Behind CMake

前端 未结 2 742
庸人自扰
庸人自扰 2021-02-05 11:52

I am trying to understand the purpose behind CMake. Why it is designed like it is right now. Here are some questions I would like to have answered.

  • Why does cmake
2条回答
  •  醉梦人生
    2021-02-05 12:56

    Since jmstoker gave already a very complete answer, I'll focus on this specific point:

    "Why do tutorials advise me to list every source file explicitly?"

    In practice you can use globbing functions, however the problem is that if you add a file, then you have to run cmake explicitly to make cmake aware of its presence. It's usually not a problem if you are working "alone", but in a shared project it can be a problem if somebody add a file, you update, and then you compile facing strange errors.

    With git there is a solution, that allow triggering "cmake ." every time a merge happens. Getting cmake to run before building after pulling from git

提交回复
热议问题