                                        "compile_includes")))
     (cond ((file-exists-p compile-includes-file)
            ;; Parse the file and return 3 lists: src, include, exclude
-           (let ((directives (rtags-load-compile-include-file-content
+           (let ((directives (rtags-load-compile-includes-file-content
                               compile-includes-file)))
              (setq *rtags-project-source-dirs*  ()
                    *rtags-project-include-dirs* ())
              (let ((source-dirs (first directives))
                    (incl-dirs   (second directives))
                    (excl-regexs (third directives)))
-               ;; TODO: if no source dirs use dir itself
-               ;; TODO: relative paths
                ;; Scan src to get all subdirs that do not match the excludes
                (dolist (path source-dirs)
+                 (setq path (expand-file-name path *rtags-compile-includes-base-dir*))
                  (message "Scanning source dir: %s" path)
                  (setq *rtags-project-source-dirs*
                        (append *rtags-project-source-dirs*
                                (rtags-scan-include-directories path excl-regexs))))
                ;; Same with includes
                (dolist (path incl-dirs)
+                 (setq path (expand-file-name path *rtags-compile-includes-base-dir*))
                  (message "Scanning include dir: %s" path)
                  (setq *rtags-project-include-dirs*
                        (append *rtags-project-include-dirs*

      (when (yes-or-no-p
             (format "Wrote compile_commands.json (%d files). Load it?" num-files))
        (rtags-call-rc :path t :output nil "-J" dir)
        ("Done (check rdm's logs).")))))

;; Mode for compile_includes


        (setq result (cons subdir result))))
    result))

(defun rtags-load-compile-includes-file (dir)
  "Loads the `compile_includes' file from the specified directory
and sets up the project's source dirs and include dirs. Return
true on success. Normally you should not use this function
