[IPOL discuss] 2 cmake questions

Nicolas Limare nicolas.limare at cmla.ens-cachan.fr
Wed Nov 30 06:17:42 CET 2011


> You could use the following
> 
> $ cmake -E make_directory build
> $ cmake -E chdir build cmake ../HelloWorld
> $ cmake --build build
> $ rm -rf ./build

Thanks, it's good to know this is possible on recent versions of
cmake. Gabriele also showed me how to remove CMakeStuff with make
clean, I think I have everything I need.

> Something that you could like is the graphivz export of dependencies :
> 
> --graphviz=[file]: Generate graphviz of dependencies.

Ah, a global file-level dependency graph, good.

For people interested in function-level dependencies (a function call
graph), I produced it some time ago for megawave using ncc[1] and a
ncc2dot conversion script (attached). The result was way too large to
be usable, but it may be good for small projects.

[1]http://students.ceid.upatras.gr/~sxanth/ncc/
   debian package "ncc"

make CC="nccgen -ncgcc -ncld -ncfabs"
FUNCTIONS=$(nm -f posix <compiled_file> | grep -Ev "(@@|__)" | cut -d\  -f1)
python ncc2dot.py <compiled_file>.nccout $FUNCTIONS > callgraph.dot
dot -Tpng callgraph.dot > callgraph.png

-- 
Nicolas LIMARE - CMLA - ENS Cachan    http://www.cmla.ens-cachan.fr/~limare/
IPOL - image processing on line                          http://www.ipol.im/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ncc2dot.py
Type: text/x-python
Size: 4733 bytes
Desc: not available
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20111130/062e624d/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20111130/062e624d/attachment.pgp>


More information about the discuss mailing list