Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I really need cmake for build automation?

I'm currently investigating cmake to allow automatic building on the Win32 platform. For all runtimes and libraries I'd like to build, Visual Studio (2008/2010) projects do allready exist.

I've come across cmake, but I'm unsure if I really need it. As the documentation says, cmake generates VS projects and they then can be built e.g. using MSBuild.

As the projects itself allready do exist (and build nicely via the IDE or MSBuild on the cmd line), what do I need and use cmake for? Just for directory/project folder traversal? Build failure reporting?

Regards, Paul

like image 225
PMiller Avatar asked Apr 10 '12 14:04

PMiller


1 Answers

Well, strictly speaking you do not need it. However, it does give you a few advantages:

  1. The idiomatic way to use CMake, forces you to use out-of-source builds. Arguable, but I am personally convinced that these keep you source-repository very clean.

  2. You can support multiple visual studio versions (with the out-of-source builds). Perhaps it will be a little easier to port your project to other compilers (from MinGW -> Linux GCC).

  3. With the find_package and config.cmake files, and a large number of available findXXX modules, CMake makes it a lot easier to "import" third-party libraries into your build-chain.

like image 159
André Avatar answered Oct 09 '22 22:10

André