You can invoke cmake --build as follows:
cmake --build . --target MyExe --config Debug
This will start from your build root, as the directory is passed as . and will build the target MyExe in Debug mode.
If your build tool is multi-configured (for example, on Windows), the --config argument matters. If you pass an invalid parameter as the configuration type here, the build tool should give an error.
If the build tool is not multi-configured (for example, gcc), then the --config argument is ignored. Instead, the assembly type is set using the CMAKE_BUILD_TYPE CMake variable; that is, it is installed when CMake starts, and not when the build tool starts.
You can pass additional parameters to the build tool by adding them at the end after -- , for example, pass -j4 if you use gcc:
cmake --build . --target MyExe -- -j4
source share