Code Monkey home page Code Monkey logo

cppdep's Introduction

cppdep

This project aims to automatically analyze the dependency structure of c++ projects. It does not depend on any specific project layout, instead it basically walks through the project structure based on your input and finds c++ source and header files, which are related to each other via include directives. After source code analysis, component analysis according to Lakos'96 component's definition is done. This definition just says that a c++ component is the combination of a .cpp file and a .h file having the same name. After component analysis, dependencies are cleaned up by applying transitive reduction to the resulting dependency graph. Finally a dot graph file is generated, which can be used to generate a .svg file, a .png file, or similar.

Install dependencies

pip install -r requirements.txt

Invocation

Simple project structure

If your project has the following structure:

project
\-- src
|   \-- *.cpp
|
\-- include
    \-- *.hpp

Then you can call the following command from the top-level project directory:

cppdep.py -I include -S src

After successful execution, a graph.dot file in the current working directory has been generated.

This can be translated to a .svg file using the following command:

dot -Tsvg graph.dot -o graph.svg

Complex project structure

If you have different components that internally follow the naming convention to use src for source files and include for include files, then you can call the following command from the top-level project directory:

cppdep.py `find -name include -exec echo -I {} \;` `find -name src -exec echo -S {} \;`

cppdep's People

Contributors

roloffs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.