[CMake] How to determine or set the order that targets are built

Michael Jackson mike.jackson at bluequartz.net
Thu Dec 28 17:49:47 EST 2017


My current project builds a bunch (30) different plugins that do NOT depend on each other. One of those plugins has about 200 files of highly templated C++ code to build which takes a while to compile and link. Meanwhile the other plugins only have about 20-40 files of "run-of-the-mill" c++ codes which all compile in a reasonably fast time. Is there a way to give a hint to CMake or the build system (Ninja or Visual Studio) to start the build of that target before the others? I know about the set target dependencies which in a way would solve the problem but I would hate to use that since there isn't an actual dependency and it really wouldn't work anyways. The link time for this large plugin is on the order of minutes on a FAST machine (Core i7 8700k overclocked).

Are the targets treated in lexographical order perhaps if there are no dependencies? I would definintely consider renaming the plugin if that meant it would kick off earlier.

Any suggestions would be great.

--
Michael Jackson | Owner, President
      BlueQuartz Software
[e] mike.jackson at bluequartz.net
[w] www.bluequartz.net




More information about the CMake mailing list