Fix CMake files

Two issues fixed here:

1. CMake treats variables in macros and functions differently, meaning that
   the unescaped ARGV wasn't actually the arguments to the macro, instead it
   was just an undefined variable.
2. CMake has a special ARGN variable, in the same vein as ARGV. However, it
   contains all the arguments *after* the formal arguments, making the
   existing `list(REMOVE_AT ARGV 0)` pattern pointless.

Should fix #2237

cc @sgolemon
Merge pull request #2246 from PocketRent/cmake-fix

Fix CMake files