Adding getopt checking in cmake.