Hacker News new | ask | show | jobs
by shadowmint 3948 days ago
FYI one of the lesser known features of cmake is that it can invoke your build tool as well:

    cmake ..
    cmake --build .
This smartly invokes make/ninja/msbuild or whatever directly from the command line; very useful on windows machines or to have 'universal' cmake runners for CI that touches multiple platforms.

(Also, tutorials; `cmake .. && cmake --build .` should smartly determine the correct compiler for the system and build it; you don't need the -G "FOO" stuff unless you're specifically doing something fancy)

1 comments

TIL! This is awesome! I never knew about this.

What does it do under Windows? Does it run say, devenv.exe/msbuild in the shell, as opposed to in Visual Studio?

Yes, that's exactly what it does, if you're using the VS backend (which is the default).

(So you can actually be in 100% console mode in windows if you want and never launch VS. :)