[CMake] Compiler/Linker flags for coverage/memcheck

David Cole david.cole at kitware.com
Fri Jun 3 11:05:39 EDT 2011


Don't do it in your CMakeLists.txt file.

Do it in the script that drives your coverage build. If the script
runs on more than one machine, then add appropriate conditionals into
the script to handle the platform differences.


HTH,
David

On Fri, Jun 3, 2011 at 3:48 AM, Arunmozhi <arunmozhi_v at yahoo.com> wrote:
> Hi,
>
> I cannot understand how to include the flags -fprofile-arcs -ftest-coverage
> to the compiler/linker flags or purify flags in my CMakeLists.txt. Why can't
> CTest application and/or INCLUDE(CTest) itself do this automatically as it
> knows the specific platform and coverage/memcheck tool used.
>
> If I explicitly add the flags to CMAKE_C_FLAGS / CMAKE_EXE_LINKER_FLAGS, the
> script becomes compiler/tool dependent. Also these flags gets included
> unwanted in normal build also.
>
> Is there a platform independent and tool independent solution for the user?
> All the tutorials only explain how to add tests and how to do "make
> Experimental/Nightly", but none of them explains how the compiler-specific
> and tool-specific flags are to be added during CTest build for the
> coverage/memcheck tools to work.
>
> Regards,
> Arun
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list