0

When I build my project with cmake I usually use the command line

cmake --build . -- -j4

when using make, or

cmake --build . -- /maxcpucount:4

when using MSBuild

Repeating this all the time is annoying and I would rather set this in the CMakeLists file instead of writing it in the command line. I am wondering if there is a cmake variable that can hold additional options for the make tool which I could set to -j4 or /maxcpucount:4 depending on which CMAKE_MAKE_PROGRAM is used.

Thank you for your time.

Knitschi
  • 2,822
  • 3
  • 32
  • 51
  • Use a shell script and a batch file? After all, there could be many options for specific generators. – utopia Jul 06 '17 at 16:53
  • See also https://gitlab.kitware.com/cmake/cmake/issues/16951 – Florian Jul 06 '17 at 19:17
  • So reading the links from the comments I get the impression that this is currently not possible, but there is a discussion within the cmake team to make the multicore build the default, which would remove my need for settings these flags. – Knitschi Jul 07 '17 at 07:53

0 Answers0