From f365ca7f6a938ce82dc9b58ba7e81a6c5864222b Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 5 Jan 2024 18:47:23 +0000 Subject: [PATCH] [cmake] ExternalProject_Add is unhappy about CMAKE_ARGS having quotes. In some cases we pass paths in quotes in CMAKE_CXX_FLAGS and that seems to confuse the ExternalProject_Add logic of our benchmarks. --- cmake/modules/GoogleBenchmark.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/modules/GoogleBenchmark.cmake b/cmake/modules/GoogleBenchmark.cmake index 9dda486d6..70c05e069 100644 --- a/cmake/modules/GoogleBenchmark.cmake +++ b/cmake/modules/GoogleBenchmark.cmake @@ -9,6 +9,11 @@ string(REPLACE "${GCC_COVERAGE_COMPILE_FLAGS}" "" CMAKE_SHARED_LIBRARY_CREATE_CX string(REPLACE "${GCC_COVERAGE_LINK_FLAGS}" "" CMAKE_EXE_LINKER_FLAGS_NOCOV "${CMAKE_EXE_LINKER_FLAGS}") string(REPLACE "${GCC_COVERAGE_LINK_FLAGS}" "" CMAKE_SHARED_LINKER_FLAGS_NOCOV "${CMAKE_SHARED_LINKER_FLAGS}") +# ExternalProject_Add does not like unescaped quotes in CMAKE_ARGS. +string(REPLACE "\"" "\\\"" ESCAPED_CMAKE_CXX_FLAGS_NOCOV "${CMAKE_CXX_FLAGS_NOCOV}") +string(REPLACE "\"" "\\\"" ESCAPED_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + +include(ExternalProject) #---Find and install google benchmark ExternalProject_Add( googlebenchmark