title: Multiple make targets in the same CMake project
body: <p>In my project I have a makefile that looks like this:</p>
  
  <pre><code>CXX = clang++
  CFLAGS = -std=c++11 
  COMMON_SOURCES = file1.cpp file2.cpp
  TARGET_SOURCES = main.cpp
  TEST_SOURCES = run_tests.cpp test_file1.cpp test_file2.cpp
  COMMON_OBJECTS = $(COMMON_SOURCES:.c=.o)
  TARGET_OBJECTS = $(TARGET_SOURCES:.c=.o)
  TEST_OBJECTS = $(TEST_SOURCES:.c=.o)
  EXECUTABLE = build/application
  TEST_EXECUTABLE = build/tests
  .PHONY: all target tests
  all: target tests
  target: $(EXECUTABLE)
  tests: $(TEST_EXECUTABLE)
  clean:
      rm build/tests &amp; rm build/application &amp;
  $(EXECUTABLE): $(COMMON_OBJECTS) $(TARGET_OBJECTS)
      $(CXX) $(CFLAGS) $(LDFLAGS) $^ -o $@
  $(TEST_EXECUTABLE): $(COMMON_OBJECTS) $(TEST_OBJECTS)
      $(CXX) $(CFLAGS) $(LDFLAGS) $^ -o $@
  .c.o:
      $(CXX) $(CFLAGS) $&lt; -o $@
  </code></pre>
  
  <p>This lets me run <code>make tests</code> or <code>make target</code> and it will build the appropriate executable.</p>
  
  <p>How do I set up a CMakeLists file to get the same convenient build system?</p>