title: change library dependencies in CMake build
body: <p>I'm building a library that depends on other static libraries, for testing, I have to change out one of the libraries for a test version. For the life of me I can't work out how to do this with CMake.</p>
  
  <p>My CMake setup is something like the following:</p>
  
  <pre><code>add_library(X STATIC x.cpp)
  
  add_library(Y STATIC y.cpp)
  
  add_library(A STATIC a.cpp)
  target_link_libraries(A X Y)
  
  add_executable(EXE main.cpp)
  target_link_libraries(EXE A)
  </code></pre>
  
  <p>This works fine, but now I want to create another executable that uses TEST_X instead of X. This is a simplified example, but I have a very complex dependencies from a legacy system.</p>
  
  <p>So, how do I build a new executable linked with the different library (TEST_X instead of X)?</p>