Skip to content
Snippets Groups Projects
Commit efd3d21b authored by vargheseg's avatar vargheseg
Browse files

Support case insensitive CMAKE_BUILD_TYPE

Cmake treats CMAKE_BUILD_TYPE string as case insensitve. Make the check
for enabling coverage reflect this to make usage less restrictive.
parent b1db59e5
No related branches found
No related tags found
No related merge requests found
...@@ -27,8 +27,11 @@ ...@@ -27,8 +27,11 @@
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 --coverage") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 --coverage")
#The make coverage command is only available in debug mode # The make coverage command is only available in debug mode. Also
IF(CMAKE_BUILD_TYPE STREQUAL "Debug") # factor in that cmake treats CMAKE_BUILD_TYPE string as case
# insensitive.
string(TOUPPER ${CMAKE_BUILD_TYPE} build_type_uppercase)
IF(build_type_uppercase STREQUAL "DEBUG")
configure_file(cmake/make_coverage.sh.in configure_file(cmake/make_coverage.sh.in
${PROJECT_BINARY_DIR}/make_coverage.sh @ONLY) ${PROJECT_BINARY_DIR}/make_coverage.sh @ONLY)
add_custom_target(coverage add_custom_target(coverage
...@@ -36,5 +39,5 @@ IF(CMAKE_BUILD_TYPE STREQUAL "Debug") ...@@ -36,5 +39,5 @@ IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating test coverage documentation" VERBATIM COMMENT "Generating test coverage documentation" VERBATIM
) )
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug") ENDIF()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment