<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;"> if (APPLE)</span><br><span style="font-family: courier new,monospace; font-size: 12px;"> SET(CMAKE_C_COMPILER "/usr/bin/clang")</span><br><span style="font-family: courier new,monospace; font-size: 12px;"> SET(CMAKE_CXX_COMPILER "/usr/bin/clang++")</span><br><span style="font-family: courier new,monospace; font-size: 12px;"> endif (APPLE)</span><br><br>But the result from the build is:<br><span style="font-family: courier new,monospace; font-size: 12px;"> -- Update Continuous --</span><br><span style="font-family: courier new,monospace; font-size: 12px;"> -- Configure Continuous --</span><br><span style="font-family: courier new,monospace; font-size: 12px;"> -- Reading custom configuration Continuous - Arachne --</span><br><span style="font-family: courier new,monospace; font-size: 12px;"> -- Build Continuous --</span><br><span style="font-family: courier new,monospace; font-size: 12px;"> -- 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;"> -- Coverage Continuous --</span><br><span style="font-family: courier new,monospace; font-size: 12px;"> Cannot find any coverage files. Ignoring Coverage request.</span><br><span style="font-family: courier new,monospace; font-size: 12px;"> -- 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;"> -- Submit Continuous --</span><br><br>Best Regards<br>NoRulez<br></div><div><br>Am 24. März 2012 um 17:31 schrieb "NoRulez" <norulez@me.com>:<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 <david.cole@kitware.com>:<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&status=3" data-mce-href="http://my.cdash.org/viewCoverage.php?buildid=313323&status=3">http://my.cdash.org/viewCoverage.php?buildid=313323&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 <<a href="mailto:david.cole@kitware.com" data-mce-href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br> > The answer to that stackoverflow question recommends using<br> > clang/clang++ instead. (I have not tried this yet myself, but would<br> > not be entirely surprised to find out it's correct. I have observed<br> > the zero coverage phenomenon on my own Mac laptop, but have sufficient<br> > coverage capabilities elsewhere... so I didn't care enough to follow<br> > up on it previously.)<br> ><br> ><br> > HTH,<br> > David<br> ><br> ><br> ><br> > On Sat, Mar 24, 2012 at 8:51 AM, David Cole <<a href="mailto:david.cole@kitware.com" data-mce-href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br> >> Perhaps it's because of this problem with the Mac "gcc" which is not<br> >> *really* just gcc anymore, and apparently doesn't support gcov<br> >> transparently as it should...<br> >><br> >> <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> >><br> >><br> >> On Sat, Mar 24, 2012 at 7:45 AM, <<a href="mailto:norulez@me.com" data-mce-href="mailto:norulez@me.com">norulez@me.com</a>> wrote:<br> >>> Hello,<br> >>><br> >>> I have the following code in the main CTestScript.cmake which I call with<br> >>> "ctest -S CTestScript.cmake, Continuous":<br> >>><br> >>> SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W<br> >>> -Wunused-variable -Wunused-parameter -Wunused-function -Wunused<br> >>> -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings<br> >>> -fprofile-arcs -ftest-coverage")<br> >>> SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs<br> >>> -ftest-coverage")<br> >>> SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs<br> >>> -ftest-coverage")<br> >>> SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}<br> >>> -fprofile-arcs -ftest-coverage")<br> >>> SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}<br> >>> -fprofile-arcs -ftest-coverage")<br> >>><br> >>> FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "<br> >>> CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@<br> >>> CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@<br> >>> CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@<br> >>> CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@<br> >>> CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@<br> >>> ")<br> >>><br> >>><br> >>> ## -- Configure<br> >>> message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --")<br> >>> ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")<br> >>><br> >>><br> >>><br> >>> On Windows XP and on Ubuntu Linux Server 11.10 it works and I get coverage<br> >>> information.<br> >>><br> >>> But on OS X Lion Server I didn't get any coverage informations.<br> >>><br> >>> On OS X the command gcov is available.<br> >>><br> >>><br> >>> Could someone please help?<br> >>><br> >>><br> >>> Thanks in advance<br> >>><br> >>><br> >>> Best Regards<br> >>><br> >>> NoRulez<br> >>><br> >>><br> >>> --<br> >>><br> >>> Powered by <a href="http://www.kitware.com" data-mce-href="http://www.kitware.com">www.kitware.com</a><br> >>><br> >>> Visit other Kitware open-source projects at<br> >>> <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> >>><br> >>> Please keep messages on-topic and check the CMake FAQ at:<br> >>> <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> >>><br> >>> Follow this link to subscribe/unsubscribe:<br> >>> <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>