title: specifying link flags for only one static lib while linking executable
body: <p>I have an executable built from several object files and linked with several static and shared libraries. I want to specify -Wl,-whole-archive linker option to one of linked libraries.</p>
  
  <p>For example, from this command:</p>
  
  <pre><code>/usr/bin/c++ _objectFiles_ -o _myExec_  _someCommonOptions_  _myLibraries_ -Wl,-rpath _path to libs_
  </code></pre>
  
  <p>I want to get this command:</p>
  
  <pre><code>/usr/bin/c++ _objectFiles_ -o _myExec_  _someCommonOptions_  _allOtherLibs_ \
    -Wl,-whole-archive _one particular lib_ -Wl,-no_whole-archive -Wl,-rpath _path to libs_
  </code></pre>
  
  <p>Is it any way I can achieve this using cmake? As I understand when I add something like </p>
  
  <pre><code>set_target_properties(myExec PROPERTIES LINK_FLAGS "-Wl,-whole-archive")
  </code></pre>
  
  <p>then <code>-whole-archive</code> options is set for all linked libraries and this is definitely not what I want.</p>
  
  <p>Thank you.</p>