Update cmakelists to handle terminfo