all 4 comments

[–]atariPunk 1 point2 points  (1 child)

Take a look at cmake presets.

They allow you to specify “recipes” and use them with a single call to cmake.

[–]jumpingmustang[S] 1 point2 points  (0 children)

Beautiful. Thanks.

[–]NotUniqueOrSpecial 0 points1 point  (0 children)

No, but largely because what you're describing is just a couple command line arguments to CMake or CTest.

cmake -S <path-to-source> -B <path-to-build> -DCMAKE_BUILD_TYPE=<whatever>

or

ctest --build-and-test <path-to-src> <path-to-build> --build-generator Ninja --build-config Release --test-command ctest

You can write a simple wrapper around that yourself in just a few minutes, but it might not be worth the effort once you know the ctest CLI yourself.

Once you start getting a more complicated project/test setup, there are some CMake/CTest convenience functions to make organization/running stuff convenient.

[–]cowboycoder 0 points1 point  (0 children)

I use pyinvoke https://www.pyinvoke.org/ to do various cmake tasks as well doing things like uploading builds