title: How to build target by name in CMake?
body: <p>I have cmake project that consist of multiple targets.</p>
  
  <pre><code>MyProject/
  /target1
         /Some stuff
         /CMakeLists.txt // here add_executable(target1 main.c)
  /target2
  /target3
  ...
  CMakeLists.txt // root CMakeLists.txt file
  /build // folder for build files
  </code></pre>
  
  <p>I wand to build only target1 and put it into /build folder inside my project </p>
  
  <p>I could build all targets</p>
  
  <pre><code>[MyProject/build]$ cmake ..
  [MyProject/build]$ make
  </code></pre>
  
  <p>How to build only target1?</p>
  
  <p>I guess it must be something like this?</p>
  
  <pre><code>[MyProject/build]$ cmake ..
  [MyProject/build]$ cmake --build . --target target1 -- -j 12
  </code></pre>