Skip to content

Commit eba63de

Browse files
authored
Merge pull request #652 from conan-io/fix/json_semicolons
fixing json parsin when there are semicolons
2 parents 24e91d6 + 387c0a3 commit eba63de

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

conan_provider.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,13 +473,13 @@ function(conan_install)
473473
# the files are generated in a folder that depends on the layout used, if
474474
# one is specified, but we don't know a priori where this is.
475475
# TODO: this can be made more robust if Conan can provide this in the json output
476-
string(JSON CONAN_GENERATORS_FOLDER GET ${conan_stdout} graph nodes 0 generators_folder)
476+
string(JSON CONAN_GENERATORS_FOLDER GET "${conan_stdout}" graph nodes 0 generators_folder)
477477
cmake_path(CONVERT ${CONAN_GENERATORS_FOLDER} TO_CMAKE_PATH_LIST CONAN_GENERATORS_FOLDER)
478478
# message("conan stdout: ${conan_stdout}")
479479
message(STATUS "CMake-Conan: CONAN_GENERATORS_FOLDER=${CONAN_GENERATORS_FOLDER}")
480480
set_property(GLOBAL PROPERTY CONAN_GENERATORS_FOLDER "${CONAN_GENERATORS_FOLDER}")
481481
# reconfigure on conanfile changes
482-
string(JSON CONANFILE GET ${conan_stdout} graph nodes 0 label)
482+
string(JSON CONANFILE GET "${conan_stdout}" graph nodes 0 label)
483483
message(STATUS "CMake-Conan: CONANFILE=${CMAKE_SOURCE_DIR}/${CONANFILE}")
484484
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/${CONANFILE}")
485485
# success

example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.24)
22

3-
project(FormatOutput LANGUAGES CXX)
3+
project(FormatOutput LANGUAGES CXX C)
44

55
set(CMAKE_CXX_STANDARD 14)
66

example/conanfile.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ fmt/9.1.0
33

44
[layout]
55
cmake_layout
6+
7+
[generators]
8+
CMakeDeps

0 commit comments

Comments
 (0)