public static File findCurrentModuleDir(String directory)
    {
        // will find something by traversing up
        File current = new File(directory);
        if (current.getName().equalsIgnoreCase("."))
        {
            // strange bugfix here...
            current = current.getParentFile();
        }
        if (current == null || current.getParentFile() == null)
        {
            return null;
        }
        while (current.getParentFile() != null)
        {
            if (current.exists() && current.getParentFile().getName().equals(Constants.MODULES_FOLDERNAME) && new File(current, Constants.CMAKELISTS_FILENAME).exists())
            {
                return current;
            }
            current = current.getParentFile();
        }
        return null;
    }