Skip to content

Commit

Permalink
fixing json parsin when there are semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
memsharded committed Jul 1, 2024
1 parent 24e91d6 commit 387c0a3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions conan_provider.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.24)

project(FormatOutput LANGUAGES CXX)
project(FormatOutput LANGUAGES CXX C)

set(CMAKE_CXX_STANDARD 14)

Expand Down
3 changes: 3 additions & 0 deletions example/conanfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ fmt/9.1.0

[layout]
cmake_layout

[generators]
CMakeDeps

0 comments on commit 387c0a3

Please sign in to comment.