diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py
index dca206f51f42f26198a332e3846ce357a0054c75..1236604b212ceca0c5fadcf1fd4fb3f78d664019 100644
--- a/indra/cmake/run_build_test.py
+++ b/indra/cmake/run_build_test.py
@@ -83,6 +83,11 @@ def main(command, libpath=[], vars={}):
         # Append the sequence in libpath
         print "%s += %r" % (var, libpath)
         dirs.extend(libpath)
+        # Filter out some useless pieces
+        clean_dirs = []
+        for dir in dirs:
+            if dir and dir not in ('', '.'):
+                clean_dirs.append(dir)
         # Now rebuild the path string. This way we use a minimum of separators
         # -- and we avoid adding a pointless separator when libpath is empty.
         os.environ[var] = os.pathsep.join(dirs)