Updated core cmake files to not rebuild stuff that is up to date.

The method is a bit "messy"(generating an empty file to indicate the date at which the target has last been built), but it seems to work fine.

Main advantage is that you can now change .cpp files, and the lua bindings will not be regenerated because of it.