[CMake] Simultaneous makes?

David Thompson david.thompson at kitware.com
Mon Jan 12 11:59:08 EST 2015


Hi Chris,

> One of my co-workers likes to start multiple makes in various parts of his project source tree.  Under our old Makefile-based, build-in-source system, this worked fine. Under our new CMake-based, out-of-source build system, this causes problems, since any make might cause CMake to rebuild its internal files.
> 
> Is this a "don't do that" problem, or can CMake be used in a manner where it is smart enough not to step on its own toes?

One workaround would be to run cmake manually before setting off multiple "(cd blah; make)" processes in the background. CMake should not need to run multiple times per "make" invocation unless you are doing something very strange.

Also, if you are using your personal knowledge of project dependencies and know it is OK to skip some steps, you might try making the "/fast" version of targets in those subdirectories without rebuilding their indirect dependencies (e.g., if "make foo" works, you can "make foo/fast" to avoid rebuilding other targets that foo depends on). I am less sure that this avoids re-runs of CMake, but I don't recall it doing that in general.

	David


More information about the CMake mailing list