Integrating with CMake
On non-Windows systems, you can translate projects that are built with CMake by incorporating a JSON compilation database in the OpenText SAST command. This is only supported for Makefile and Ninja generators (see the CMake Reference Documentation for more information).
To integrate OpenText SAST with a CMake build:
Generate a
compile_commands.jsonfile for your CMake project.Add
-DCMAKE_EXPORT_COMPILE_COMMANDS=yesto thecmakeconfigure command. For example:cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=yes
Include the JSON compilation database in your
sourceanalyzercommand as follows:sourceanalyzer -b <build_id> compile_commands.json