title: Cmake compile with Frameworks on Mac OSX and treat .cpp files like .m/.mm
body: <p>I'm looking for a tip to get the following to work, here is my CMakeLists.txt</p>
  
  <pre>
  # cmake_minimum_required(2.8.2)
  
  project(boilerplate)
  
  # base files
  set(src_files
    src/greet.h
    src/main.cpp
  )
  
  # if on OSX, these files are needed
  if(APPLE)
  
    SET(CMAKE_EXE_LINKER_FLAGS "-framework Foundation -w")
  
    set(src_files
      ${src_files}
      src/mac/greet.mm
      src/mac/greeting.h
      src/mac/greeting.m
    )
  endif()
  
  # if on windows, these files are needed
  if(WIN32)
    set(src_files
      ${src_files}
      src/win/greet.cpp
    )
  endif()
  
  add_executable(greeting
    ${src_files}
  )
  </pre>
  
  <p>I require that on OSX the .cpp files are treated like .mm files (but on Windows, not) and that I can load the core foundation, etc frameworks... I'm a complete cmake newbie, so I can't even begin to know where to start, but I hope I'm somehow in the right direction, current output is:</p>
  
  <pre>
  $ cmake CMakeLists.txt && make
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /Users/leehambley/Projects/watched.it-client
  Scanning dependencies of target greeting
  [ 33%] Building CXX object CMakeFiles/greeting.dir/src/mac/greet.o
  Linking CXX executable greeting
  Undefined symbols:
    "greet()", referenced from:
        _main in main.o
  ld: symbol(s) not found
  collect2: ld returned 1 exit status
  make[2]: *** [greeting] Error 1
  make[1]: *** [CMakeFiles/greeting.dir/all] Error 2
  make: *** [all] Error 2
  1
  </pre>