From 083451817d56639dcf1a890262f7307858b7c735 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 30 May 2023 10:40:55 +0200 Subject: [PATCH] [cmake] Make sure that string(REPACE always has 4 arguments. This was missing proper quoting for the case that dune-common_CXX_FLAGS is empty. Error I got was: ``` -- Version 2.10.0 of dune-common from /home/mblatt/src/dune/opm-master/dune-common/opm-parallel CMake Error at CMakeLists.txt:369 (string): string sub-command REPLACE requires at least four arguments. -- Configuring incomplete, errors occurred! ``` --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 51340f911..44bfe49df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -366,7 +366,7 @@ endif() find_package(dune-common REQUIRED) opm_need_version_of ("dune-common") target_include_directories(dunecommon INTERFACE ${dune-common_INCLUDE_DIRS}) -string(REPLACE " " ";" dflags ${dune-common_CXX_FLAGS}) +string(REPLACE " " ";" dflags "${dune-common_CXX_FLAGS}") target_compile_options(dunecommon INTERFACE ${dflags}) target_compile_definitions(dunecommon INTERFACE DUNE_COMMON_VERSION_MAJOR=${DUNE_COMMON_VERSION_MAJOR}) target_compile_definitions(dunecommon INTERFACE DUNE_COMMON_VERSION_MINOR=${DUNE_COMMON_VERSION_MINOR})