Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Fortify sourceanalyzer with CMake

I have a Makefile generated by CMake. The following path to CMake executable is set in the Makefile:

CMAKE_COMMAND = /home/xyz/opt/cmake/cmake-3.1.1/bin/cmake

How can I integrate Fortify sourceanalyzer with it and run scans?

like image 504
user2361273 Avatar asked Feb 08 '23 08:02

user2361273


1 Answers

I had the same challenge but solved it by running it like this:

  1. sourceanalyzer -b project_ID -clean
  2. Go to your build directory and perform make clean or remove all contents including the Makefile
  3. Run cmake by changing CC and CXX variables: CC="sourceanalyzer -b project_ID gcc" CXX="sourceanalyzer -b project_ID g++" cmake ..
  4. Run make and fortify should be translating files while compilers do their job.
  5. Run sourceanalyzer -b project_ID -scan -f results.fpr

Hope it helps.

like image 167
Stan Avatar answered Mar 19 '23 09:03

Stan