title: CMake: Linking multiple libraries to two executables in one command
body: <p>I've got two executables both of which need to be linked to N libraries which are the same:</p>
  
  <pre><code>add_executable(MyExe1 main1.cpp)
  add_executable(MyExe2 main2.cpp)
  
  target_link_libraries(MyExe1 lib1 lib2 lib3 ... libN)
  target_link_libraries(MyExe2 lib1 lib2 lib3 ... libN)
  </code></pre>
  
  <p>So I have to write <code>target_link_libraries</code> twice; once for <code>MyExe1</code> and once for <code>MyExe2</code>. Is there any way to shorten the way some common libraries are linked to two different executables? I am wondering if it's possible to link <code>lib1</code> ... <code>libN</code> libraries to both <code>MyExe1</code> and <code>MyExe2</code> in one command to avoid redundancy and make the CMake file cleaner.</p>