We click on Add CMake project and select compile_command.json in the file dialog. We enter a proper project name (e.g., MyApp) and selected a project directory (e.g., /path/to/build-cppdepend), where CppDepend can store all its generated files.Īfter we click OK in the welcome dialog, CppDepend shows its main screen. On the dialog Welcome to CppDepend, we click on the button Create a New CppDepend Project. We start CppDepend with $ /path/to/CppDepend/VisualCppDepend.sh & The database contains an entry for each compiler call with the current build directory, the compiler call with all options and arguments and the source file. The extra option makes CMake write a JSON compilation database compile_commands.json to the build directory. $ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON We add the option -DCMAKE_EXPORT_COMPILE_COMMANDS=ON to our normal CMake call and keep all the other options and arguments like the and from the normal CMake call. We must create a JSON compilation database for a CMake project, before it makes sense to start CppDepend. Two days later I gave CppDepend a second chance. No hint what to do! Nothing!Īt that point, I was close to giving up on the evaluation. CppDepend responded with the error message that this is an invalid CMake project. I created my first CppDepend project and loaded my project’s top-level CMakeLists.txt file. I still had to reduce the resolution from 2.5K to full HD in the Linux VM. Much less zooming and scrolling needed!Īs I didn’t want to change my development setup (QtCreator in full-screen mode with two editor windows and one sidebar), I changed to a laptop. It should because working with big dependency graphs is so much easier on a 4K monitor. CppDepend doesn’t support high-DPI monitors. The texts in the UI were so tiny on my 4K monitor that I couldn’t read them from 5cm. I installed CppDepend on my development PC and started it. I used CppDepend for the dependency analysis. The next steps would be to eliminate the cycles, to re-organise the namespaces and to turn the namespaces into mostly independent libraries. My evaluation goal is to find all dependency cycles between classes. In other words, the application is the ideal test case for evaluating a dependency analyser. The code structure is a mess and in dire need of improvement. Changes take much more time than they should and break the application in unexpected places. The abstraction level of classes is low, interfaces hardly exist. Namespaces and classes have cyclic dependencies. The namespaces and classes are tightly coupled with little cohesion. ![]() I am currently working on an embedded Qt/C++ application with over 300 classes grouped into over 30 namespaces. Without rewriting the the source code, CppDepend would have found no cycles at all. CppDepend only found less than 10% of the cycles. I know that the application contains 50+ dependency cycles. My goal was to find all dependency cycles between classes in the application. I evaluated the dependency analyser CppDepend on a real-life embedded application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |