Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I could not get CMake to build with Coverity. I am new to CMake and not sure how to fix this problem. I am able to build sample program with this command:
cov-build --dir . gcc sample.cc -o sample.o
However, when I tried to build with CMake
cov-build --dir . cmake ../
I am getting the no emit error:
Coverity Build Capture (64-bit) version 2017.07 on Linux 3.10.0-693.21.1.el7.x86_64 x86_64
Internal version numbers: 7a4de27b47 p-milo-push-30112.654
-- Using Build Type provided on command line
-- Library config4cpp Found
-- CONFIG4CPP_INCLUDE_DIRS=/opt/config4cpp/include
-- CONFIG4CPP_LIBRARIES=/opt/config4cpp/lib/libconfig4cpp.a
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hitp6130/pulsar
[WARNING] No files were emitted. This may be due to a problem with your configuration
or because no files were actually compiled by your build command.
Please make sure you have configured the compilers actually used in the compilation.
For more details, please look at:
/home/hitp6130/pulsar/build/build-log.txt
–
–
–
–
–
–
Arcoding to the coverity guidline, I think cmake is not the simple case, and you need the full version of the command as bellow:
cov-configure --template --compiler <compiler-binary-name> --comptype <compiler-type>
Example:
cov-configure --config cc-config.xml --template --comptype gcc --compiler cc
cmake ..
cov-build --dir <build-dir> --config cc-config.xml make
cc-config.xml is the configuration file which coverity generate. You can use different name as you need.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.