Understanding CppDepend Analysis Inputs

Understanding CppDepend Analysis Inputs


This short document clarifies from where CppDepend analysis takes its inputs.
The CppDepend is based on Clang to parse the source files, and to achieve the code analysis, CppDepend needs the following inputs:

  • Source files.
  • Include paths.
  • Defines.
  • forced includes.
In the C/C++ world there are a lot of managed build systems out there now. Each one has its way to define these data.

CppDepend provides out of the box the analysis of Visual Studio projects, you have just to give a .sln, .vcxproj or a .vcproj to CppDepend.

And for the other cases two ways are provided:

  • Using the Build Monitor: The goal of the Build Monitor is to intercept all the compilation and link commands executed from your build system command, and generate a build file specification containing all data needed by CppDepend. This is the recommended way to describe your build specification for your projects other than VS ones.
  • Using the ProjectMaker: The Project Maker tool allows you to describe your projects by specifying your source files, include paths and defines. This method is not adapted to big projects, indeed it's not an easy task to give manually all your source files with the include paths and the defines. However, this tool is very suitable as described here, to refine the External libraries used by your projects.

And to give your projects to CppDepend, you can use one of the following three options:

  • Browse: To give your project from the explorer.
  • Add Projects from VS Solutions: This wizard shows the recent used Visual Studio projects and solutions
  • Add Projects in Folder: This facility permits to give many projects and solutions from directories (recursively or not), to avoid giving manually each project.