我没用过cscope。我想知道构建(数据库)并将cscope与opencv一起使用的说明。
另外,它仅适用于C程序吗? C++怎么样?
最佳答案
在搜寻相同主题时,我发现了这个久违的问题。这就是我所发现的。
根据cscope home page
The fuzzy parser supports C, but is flexible enough to be useful for C++ and Java, and for use as a generalized 'grep database' (use it to browse large text documents!)
因此,我继续为opencv2生成了一个cscope数据库,该数据库或多或少是根据cscope large projects tutorial改编的
为了生成适当的cscope.files,如果在下面的OCV2目录中进行搜索,则可以运行find命令,删除大量多余的目录和文件。
#!/bin/bash
OCV2=~/src/opencv/opencv
find $OCV2 -path "$OCV2*/.git" -prune -o -path "$OCV2*/samples" -prune -o -path "$OCV2*/cmake" -prune -o -path "$OCV2*/data" -prune -o -path "$OCV2*/doc" -prune -o -path "$OCV2*/platforms" -prune -o -path "$OCV2*/release" -prune -o -iname "*\.cpp" -print -o -iname "*\.hpp" -print -o -iname "*\.c" -print -o -iname "*\.h" -print > cscope.files
现在,您将要生成cscope数据库,方法是在与cscope.files相同的目录中运行以下命令cscope -b -q -k
这将创建文件:cscope.in.out cscope.out cscope.po.out
如果您将环境变量$ CSCOPE_DB设置为指向cscope.out
,则可以开始使用了。如果您还有其他问题,请告诉我。
关于opencv - 有没有办法为opencv建立cscope数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25419015/