title: How can I build multiple binaries with Cargo?
body: <p>I'd like to make a project with a <code>daemon</code> and a <code>client</code>, connecting through a unix socket. </p>
  
  <p>A <code>client</code> and a <code>daemon</code> requires two binaries, so how do I tell <code>Cargo</code> to build two targets from two different sources?</p>
  
  <p>To add a bit of fantasy, I'd like to have a <code>library</code> for the main part of the <code>daemon</code>, and just have a binary to wrap around it and communicate through sockets.</p>
  
  <p>So, we have this kind of tree architecture:</p>
  
  <pre><code>├── Cargo.toml
  ├── target
  |   └── debug
  |       ├── daemon
  │       └── client
  └── src
      ├── daemon
      │   ├── bin
      │   │   └── main.rs
      │   └── lib
      │       └── lib.rs
      └── client
          └── bin
              └── main.rs
  </code></pre>
  
  <p>I could make one executable which manages both concerns, but that's not what I want to do, unless it's very good practice.</p>