<html><body><div>I've tried to set the C/C++ compiler as followed:<br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;&nbsp;&nbsp; if (APPLE)</span><br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SET(CMAKE_C_COMPILER "/usr/bin/clang")</span><br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SET(CMAKE_CXX_COMPILER "/usr/bin/clang++")</span><br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;&nbsp;&nbsp; endif (APPLE)</span><br><br>But the result from the build is:<br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;-- Update Continuous --</span><br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;-- Configure Continuous --</span><br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;-- Reading custom configuration Continuous - Arachne --</span><br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;-- Build Continuous --</span><br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;-- Test Continuous --</span><br><span style="font-family: courier new,monospace; font-size: 12px;">No tests were found!!!</span><br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;-- Coverage Continuous --</span><br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;Cannot find any coverage files. Ignoring Coverage request.</span><br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;-- Memcheck Continuous --</span><br><span style="font-family: courier new,monospace; font-size: 12px;">No tests were found!!!</span><br><span style="font-family: courier new,monospace; font-size: 12px;">&nbsp;-- Submit Continuous --</span><br><br>Best Regards<br>NoRulez<br></div><div><br>Am 24. März 2012 um 17:31 schrieb "NoRulez" &lt;norulez@me.com&gt;:<br><br><div><blockquote type="cite"><div class="msg-quote"><div>I've found this http://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmake<br><br>Is this all which I need to configure or did you do something different/special?<br>Please could you post your settings to use clang instead of gcc on OS X<br><br>Thanks in advance<br><br>Best Regards<br>NoRulez<br></div><div><br>Am 24. März 2012 um 15:31 schrieb David Cole &lt;david.cole@kitware.com&gt;:<br><br><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch">Well, I've had mixed results trying this myself.<br> <br> With the trivial SmallAndFast project, I get a good coverage<br> measurement on 5 lines of code in 1 source file:<br> <a href="http://my.cdash.org/viewCoverage.php?buildid=313323&amp;status=3" data-mce-href="http://my.cdash.org/viewCoverage.php?buildid=313323&amp;status=3">http://my.cdash.org/viewCoverage.php?buildid=313323&amp;status=3</a><br> <br> With CMake itself, I get a bunch of *.gcda files generated in the<br> build tree, but the coverage info does not get communicated properly<br> via a ctest script sending to CDash. Looks like there's some issue<br> with ctest parsing of the gcov output using ctest 2.8.7 and clang on<br> the Mac and gcov 4.2.1:<br> <br> $ gcov --version<br> gcov (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)<br> <br> Looks like there's a problem somebody will have to fix before it will<br> work. Unfortunately, the gcov parsing code in ctest is a bit of a<br> tangle -- last time I was in there, I fixed some stuff up to work in a<br> MinGW environment, and it's not pretty. Also unfortunately, I don't<br> think I'll have the bandwidth to look at this myself in the near<br> future: anybody want to volunteer to take a look and submit a patch to<br> get this working...?<br> <br> <br> Thx,<br> David<br> <br> <br> On Sat, Mar 24, 2012 at 8:53 AM, David Cole &lt;<a href="mailto:david.cole@kitware.com" data-mce-href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt; wrote:<br> &gt; The answer to that stackoverflow question recommends using<br> &gt; clang/clang++ instead. (I have not tried this yet myself, but would<br> &gt; not be entirely surprised to find out it's correct. I have observed<br> &gt; the zero coverage phenomenon on my own Mac laptop, but have sufficient<br> &gt; coverage capabilities elsewhere... so I didn't care enough to follow<br> &gt; up on it previously.)<br> &gt;<br> &gt;<br> &gt; HTH,<br> &gt; David<br> &gt;<br> &gt;<br> &gt;<br> &gt; On Sat, Mar 24, 2012 at 8:51 AM, David Cole &lt;<a href="mailto:david.cole@kitware.com" data-mce-href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt; wrote:<br> &gt;&gt; Perhaps it's because of this problem with the Mac "gcc" which is not<br> &gt;&gt; *really* just gcc anymore, and apparently doesn't support gcov<br> &gt;&gt; transparently as it should...<br> &gt;&gt;<br> &gt;&gt; &nbsp;<a href="http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app" data-mce-href="http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app">http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app</a><br> &gt;&gt;<br> &gt;&gt;<br> &gt;&gt; On Sat, Mar 24, 2012 at 7:45 AM, &nbsp;&lt;<a href="mailto:norulez@me.com" data-mce-href="mailto:norulez@me.com">norulez@me.com</a>&gt; wrote:<br> &gt;&gt;&gt; Hello,<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; I have the following code in the main CTestScript.cmake which I call with<br> &gt;&gt;&gt; "ctest -S CTestScript.cmake, Continuous":<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; &nbsp; &nbsp; SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W<br> &gt;&gt;&gt; -Wunused-variable -Wunused-parameter -Wunused-function -Wunused<br> &gt;&gt;&gt; -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings<br> &gt;&gt;&gt; -fprofile-arcs -ftest-coverage")<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp; SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs<br> &gt;&gt;&gt; -ftest-coverage")<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp; SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs<br> &gt;&gt;&gt; -ftest-coverage")<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp; SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}<br> &gt;&gt;&gt; -fprofile-arcs -ftest-coverage")<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp; SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}<br> &gt;&gt;&gt; -fprofile-arcs -ftest-coverage")<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp; FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ")<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp; ## -- Configure<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp; message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --")<br> &gt;&gt;&gt; &nbsp;&nbsp;&nbsp; ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; On Windows XP and on Ubuntu Linux Server 11.10 it works and I get coverage<br> &gt;&gt;&gt; information.<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; But on OS X Lion Server I didn't get any coverage informations.<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; On OS X the command gcov is available.<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; Could someone please help?<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; Thanks in advance<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; Best Regards<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; NoRulez<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; --<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; Powered by <a href="http://www.kitware.com" data-mce-href="http://www.kitware.com">www.kitware.com</a><br> &gt;&gt;&gt;<br> &gt;&gt;&gt; Visit other Kitware open-source projects at<br> &gt;&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" data-mce-href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br> &gt;&gt;&gt;<br> &gt;&gt;&gt; Please keep messages on-topic and check the CMake FAQ at:<br> &gt;&gt;&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" data-mce-href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><br> &gt;&gt;&gt;<br> &gt;&gt;&gt; Follow this link to subscribe/unsubscribe:<br> &gt;&gt;&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" data-mce-href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><br></div></div></blockquote></div></div></div></blockquote></div></div></body></html>