Populating the Project with Source Files via the CLI

As in Populating Project With Source Files - C&C++ Projects, a newly created Helix QAC project is empty and needs to be populated with the source files to be analyzed. The most effective way to do this is through the "synchronization" method; the software observes a build being conducted, and is able to identify not only the source files that comprise the code project, but also a number of salient details such as the header file, include directories and compiler settings. With this simple example, it is accomplished using the following command, executed from the Helix QAC project directory:

qacli analyze -P <directory> -b make

This command line is now explained:

  • qacli
  • The executable being invoked.

  • analyze
  • The subcommand being invoked.

  • -P <directory>
  • A switch on the analyze subcommand. This switch is used to specify the project that is to be populated. The following text should be the location of the project. The path to the Helix QAC project to be analyzed. If the command is being executed from the Helix QAC directory, the path can be replaced with the "." shorthand.

  • -b
  • A switch on the analyze subcommand. This switch is used to indicate that the following text is a script to be run, and that the execution of the script is to be monitored and used to populate the Helix QAC project with the source files to be analyzed, and other salient information about the build process. In this simple case, because the command is being executed from the location of the Makefile, the simple make command can be issued.

  • make
  • This is the command that will cause the software project to be built, so that the Helix QAC software can observe the build process. More typically, this should be an executable script that could be called from anywhere within the directory tree.

Executing this should produce output of the following nature1:

g++ -o outputFile hello.cpp hello2.cpp ./subDirectory/code.cpp
<PROJECT_DIR>/hello.cpp - found
<PROJECT_DIR>/hello2.cpp - found
<PROJECT_DIR>/subDirectory/code.cpp - found
The command 'make' has completed with an exit code of 0
<PROJECT_DIR>/subDirectory/code.cpp:qacpp:0:1:2
<PROJECT_DIR>/hello.cpp:qacpp:0:2:1
<PROJECT_DIR>/hello2.cpp:qacpp:0:3:0
Progress(Sync Analysis): ................................... done

It can be seen that each source file was identified during the software build, and that, following the successful return of the make command, analysis of the files began. At this point, you could examine the results as discussed in Analyzing a Project.