[CEDET-devel] CEDET w/OpenCV 2.3 C++ api
Brought to you by:
zappo
From: Brian <ter...@ca...> - 2012-01-30 06:46:58
|
Hi! I was referred here for help getting OpenCV C++ api working with CEDET. It seems like semantic is unable to parse the classes... like: Mat, Keypoint, DMatch, etc... But function symbols for the most part are available - though some of them do not have complete information (full declarations/parameters). I'm running the latest dev version of CEDET with emacs24.0.92. Here is an example C++ file and my emacs cedet configuration. I would appreciate any help in getting this working! I am also confused as to whether or not I *need to*/*should* use EDE to get this working. Thanks, Brian ************** #include <stdio.h> #include <vector> #include <string> #include <opencv2/opencv.hpp> #include <opencv2/core/core.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/features2d/features2d.hpp> #include <opencv2/highgui/highgui.hpp> using namespace cv; using namespace std; int main(int argc, char **argv) { Keypoint k; Mat m; // m should have members like m.clone() // k has members like k.pt (Point2f pt) // CEDET says it cannot find types... // completion window pops up showing -every- symbol it knows return 0; } ************** ;; Loads for CEDET (load-file "/home/terranpro/code/cedet/common/cedet.el") (add-to-list 'Info-default-directory-list (expand-file-name "~/code/cedet/common")) (add-to-list 'Info-directory-list (expand-file-name "~/code/cedet/common")) (add-to-list 'Info-directory-list (expand-file-name "~/code/cedet/semantic/doc")) (add-to-list 'Info-directory-list (expand-file-name "~/code/cedet/eieio")) (add-to-list 'Info-directory-list (expand-file-name "~/code/cedet/speedbar")) (add-to-list 'Info-directory-list (expand-file-name "~/code/cedet/cogre")) (add-to-list 'Info-directory-list (expand-file-name "~/code/cedet/ede")) (add-to-list 'Info-directory-list (expand-file-name "~/code/cedet/srecode")) (require 'ede) (global-ede-mode t) ;;(semantic-load-enable-minimum-features) (semantic-load-enable-code-helpers) ;;(semantic-load-enable-gaudy-code-helpers) (semantic-load-enable-excessive-code-helpers) ;;(semantic-load-enable-semantic-debugging-helpers) (require 'semantic-ia) (require 'semantic-gcc) (require 'semantic-sb) (require 'semanticdb) (global-semanticdb-minor-mode 1) (require 'semanticdb-global) (semanticdb-enable-gnu-global-databases 'c-mode) (semanticdb-enable-gnu-global-databases 'c++-mode) (require 'semantic-c) (setq semantic-load-turn-useful-things-on t) (semantic-add-system-include "/usr/include/glib-2.0" 'c-mode) (semantic-add-system-include "/usr/include/glib-2.0" 'c++-mode) (semantic-add-system-include "/usr/include/gtk-3.0" 'c-mode) (semantic-add-system-include "/usr/include/gtk-3.0" 'c++-mode) (semantic-add-system-include "/usr/local/include/" 'c-mode) (semantic-add-system-include "/usr/local/include/" 'c++-mode) (semantic-add-system-include "/usr/local/include/opencv" 'c-mode) (semantic-add-system-include "/usr/local/include/opencv2" 'c++-mode) (semantic-add-system-include "/usr/local/include/opencv" 'c-mode) (semantic-add-system-include "/usr/local/include/opencv2" 'c++-mode) (add-to-list 'semantic-lex-c-preprocessor-symbol-file '"/usr/local/include/opencv2/core/types_c.h") (add-to-list 'semantic-lex-c-preprocessor-symbol-file '"/usr/local/include/opencv2/imgproc/types_c.h") (add-to-list 'semantic-lex-c-preprocessor-symbol-map '("CV_PROP_RW" . "")) (add-to-list 'semantic-lex-c-preprocessor-symbol-map '("CV_EXPORTS" . "")) (add-to-list 'semantic-lex-c-preprocessor-symbol-map '("CV_EXPORTS_W_SIMPLE" . "")) (add-to-list 'semantic-lex-c-preprocessor-symbol-map '("CV_EXPORTS_W" . "")) (add-to-list 'semantic-lex-c-preprocessor-symbol-map '("CV_EXPORTS_W_MAP" . "")) (add-to-list 'semantic-lex-c-preprocessor-symbol-map '("CV_INLINE" . "")) (defun my-cedet-hook () (local-set-key [(control return)] 'semantic-ia-complete-symbol) (local-set-key "\C-c?" 'semantic-ia-complete-symbol-menu) (local-set-key "\C-c>" 'semantic-complete-analyze-inline) (local-set-key "\C-c=" 'semantic-decoration-include-visit) (local-set-key "\C-cj" 'semantic-ia-fast-jump) (local-set-key "\C-cq" 'semantic-ia-show-doc) (local-set-key "\C-cs" 'semantic-ia-show-summary) (local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle) (local-set-key "\C-c+" 'semantic-tag-folding-show-block) (local-set-key "\C-c-" 'semantic-tag-folding-fold-block) (local-set-key "\C-c\C-c+" 'semantic-tag-folding-show-all) (local-set-key "\C-c\C-c-" 'semantic-tag-folding-fold-all)) (add-hook 'c-mode-common-hook 'my-cedet-hook) (add-hook 'emacs-lisp-mode-hook 'my-cedet-hook) (add-hook 'lisp-interaction-mode-hook 'my-cedet-hook) (global-semantic-tag-folding-mode 1) |