[CMake] Problems with coverage on OS X Server

David Cole david.cole at kitware.com
Sat Mar 24 08:51:04 EDT 2012


Perhaps it's because of this problem with the Mac "gcc" which is not
*really* just gcc anymore, and apparently doesn't support gcov
transparently as it should...

  http://stackoverflow.com/questions/7988355/getting-0-gcov-coverage-for-a-mac-app


On Sat, Mar 24, 2012 at 7:45 AM,  <norulez at me.com> wrote:
> Hello,
>
> I have the following code in the main CTestScript.cmake which I call with
> "ctest -S CTestScript.cmake, Continuous":
>
>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -W
> -Wunused-variable -Wunused-parameter -Wunused-function -Wunused
> -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings
> -fprofile-arcs -ftest-coverage")
>     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -W -fprofile-arcs
> -ftest-coverage")
>     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs
> -ftest-coverage")
>     SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}
> -fprofile-arcs -ftest-coverage")
>     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}
> -fprofile-arcs -ftest-coverage")
>
>     FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
>          CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@
>          CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@
>          CMAKE_EXE_LINKER_FLAGS:STRING=@CMAKE_EXE_LINKER_FLAGS@
>          CMAKE_MODULE_LINKER_FLAGS:STRING=@CMAKE_MODULE_LINKER_FLAGS@
>          CMAKE_SHARED_LINKER_FLAGS:STRING=@CMAKE_SHARED_LINKER_FLAGS@
>          ")
>
>
>     ## -- Configure
>     message (" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --")
>     ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
>
>
>
> On Windows XP and on Ubuntu Linux Server 11.10 it works and I get coverage
> information.
>
> But on OS X Lion Server I didn't get any coverage informations.
>
> On OS X the command gcov is available.
>
>
> Could someone please help?
>
>
> Thanks in advance
>
>
> Best Regards
>
> NoRulez
>
>
> --
>
> 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