From 387c0a359a87efc2b14fe51bf7de4ee7536ce715 Mon Sep 17 00:00:00 2001 From: memsharded Date: Mon, 1 Jul 2024 20:55:56 +0200 Subject: [PATCH] fixing json parsin when there are semicolons --- conan_provider.cmake | 4 ++-- example/CMakeLists.txt | 2 +- example/conanfile.txt | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/conan_provider.cmake b/conan_provider.cmake index edb51e2a..95726dd1 100644 --- a/conan_provider.cmake +++ b/conan_provider.cmake @@ -473,13 +473,13 @@ function(conan_install) # the files are generated in a folder that depends on the layout used, if # one is specified, but we don't know a priori where this is. # TODO: this can be made more robust if Conan can provide this in the json output - string(JSON CONAN_GENERATORS_FOLDER GET ${conan_stdout} graph nodes 0 generators_folder) + string(JSON CONAN_GENERATORS_FOLDER GET "${conan_stdout}" graph nodes 0 generators_folder) cmake_path(CONVERT ${CONAN_GENERATORS_FOLDER} TO_CMAKE_PATH_LIST CONAN_GENERATORS_FOLDER) # message("conan stdout: ${conan_stdout}") message(STATUS "CMake-Conan: CONAN_GENERATORS_FOLDER=${CONAN_GENERATORS_FOLDER}") set_property(GLOBAL PROPERTY CONAN_GENERATORS_FOLDER "${CONAN_GENERATORS_FOLDER}") # reconfigure on conanfile changes - string(JSON CONANFILE GET ${conan_stdout} graph nodes 0 label) + string(JSON CONANFILE GET "${conan_stdout}" graph nodes 0 label) message(STATUS "CMake-Conan: CONANFILE=${CMAKE_SOURCE_DIR}/${CONANFILE}") set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/${CONANFILE}") # success diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 150fc98c..a1770f2a 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.24) -project(FormatOutput LANGUAGES CXX) +project(FormatOutput LANGUAGES CXX C) set(CMAKE_CXX_STANDARD 14) diff --git a/example/conanfile.txt b/example/conanfile.txt index 85f12618..bf528876 100644 --- a/example/conanfile.txt +++ b/example/conanfile.txt @@ -3,3 +3,6 @@ fmt/9.1.0 [layout] cmake_layout + +[generators] +CMakeDeps