diff --git a/cmake/CFlagsToVar.cmake b/cmake/CFlagsToVar.cmake index 67c899d47..b6b1af6bd 100644 --- a/cmake/CFlagsToVar.cmake +++ b/cmake/CFlagsToVar.cmake @@ -1,5 +1,8 @@ function(CFlagsToVar NAME) set(C_FLAGS ${CMAKE_C_FLAGS}) + string(REPLACE "${CMAKE_SOURCE_DIR}" "" C_FLAGS "${C_FLAGS}") + string(REPLACE "${CMAKE_BINARY_DIR}" "" C_FLAGS "${C_FLAGS}") + if (CMAKE_BUILD_TYPE) string(TOUPPER "${CMAKE_BUILD_TYPE}" CAPS_BUILD_TYPE) string(APPEND C_FLAGS " ${CMAKE_C_FLAGS_${CAPS_BUILD_TYPE}}")