diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-12 17:12:38 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-12 17:12:38 (GMT) |
commit | 3f42c2dcd48db09f37adc2d1cd884113e6936821 (patch) | |
tree | c2a8f960a23f256bf6888de3c7a19b6e08d16755 | |
parent | 72fb2cd0bd89eb40d4a96f86d464d9801ad91f59 (diff) | |
download | uscxml-3f42c2dcd48db09f37adc2d1cd884113e6936821.zip uscxml-3f42c2dcd48db09f37adc2d1cd884113e6936821.tar.gz uscxml-3f42c2dcd48db09f37adc2d1cd884113e6936821.tar.bz2 |
Link against gcov with gcc in debug builds
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9989b38..05ecd83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,6 +166,11 @@ include("${CMAKE_MODULE_PATH}/USCXMLMacros.cmake") include("${CMAKE_MODULE_PATH}/FunctionExists.cmake") include("${CMAKE_MODULE_PATH}/HeaderExists.cmake") +# we need USCXML_CORE_LIBS here for -lgcov +set(USCXML_CORE_LIBS) +set(USCXML_OPT_LIBS) +set(USCXML_FILES) + # some compiler flags #message("CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}") @@ -180,9 +185,12 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") add_definitions(-fPIC) add_definitions(-Wunreachable-code) - # coverage information - add_definitions(-fprofile-arcs) - add_definitions(-ftest-coverage) + if (CMAKE_BUILD_TYPE MATCHES ".*Deb.*") # when not building for debug + # coverage information + add_definitions(-fprofile-arcs) + add_definitions(-ftest-coverage) + list (APPEND USCXML_CORE_LIBS "gcov") + endif() # all warnings add_definitions(-Wall) @@ -306,10 +314,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) # Dependent libraries ############################################################ -set(USCXML_CORE_LIBS) -set(USCXML_OPT_LIBS) -set(USCXML_FILES) - if (NOT WIN32) # libxml2 find_package(LibXml2 REQUIRED) |