From e45edd57a6dce221f55b3e77b941989ab4b38334 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Mon, 27 Nov 2023 18:10:11 +0100 Subject: [PATCH] Add message context Signed-off-by: Cristian Le --- CMakeLists.txt | 10 ++++++---- cmake/CMakePresets-defaults.json | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8847ba3..3d0455d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,8 @@ endif () # Basic project definition # ]==============================================================================================] +list(APPEND CMAKE_MESSAGE_CONTEXT schema_validator) + # TODO: CMake >= 3.19 can use string(JSON VERSION GET "${METADATA}" "version") to load from JSON set(PROJECT_VERSION 2.4.0) @@ -119,7 +121,7 @@ FetchContent_MakeAvailable(${fetch_packages}) if (JSON_VALIDATOR_INSTALL AND NOT nlohmann_json_FOUND AND JSON_Install) # TODO: This is not ideal message(WARNING - "JsonValidator: No nlohmann::json found on the system and nlohmann_json_schema_validator will be installed\n" + "No nlohmann::json found on the system and nlohmann_json_schema_validator will be installed\n" "This will also install nlohmann::json in its typical installation path\n" "This is not ideal because it might overwrite system installed") endif () @@ -128,11 +130,11 @@ endif () # Main definition # ]==============================================================================================] -message(STATUS "JsonValidator: Configured for ${CMAKE_BUILD_TYPE}") +message(STATUS "Configured for ${CMAKE_BUILD_TYPE}") if (DEFINED nlohmann_json_VERSION) - message(STATUS "JsonValidator: Using nlohmann/json version: ${nlohmann_json_VERSION}") + message(STATUS "Using nlohmann/json version: ${nlohmann_json_VERSION}") else () - message(STATUS "JsonValidator: nlohmann_json_VERSION is not set. Possible value: ${JSON_FETCH_VERSION}") + message(STATUS "nlohmann_json_VERSION is not set. Possible value: ${JSON_FETCH_VERSION}") endif () ## Main targets diff --git a/cmake/CMakePresets-defaults.json b/cmake/CMakePresets-defaults.json index bfc642c..e4415bc 100644 --- a/cmake/CMakePresets-defaults.json +++ b/cmake/CMakePresets-defaults.json @@ -9,6 +9,10 @@ "CMAKE_BUILD_TYPE": { "type": "STRING", "value": "Release" + }, + "CMAKE_MESSAGE_CONTEXT_SHOW": { + "type": "BOOL", + "value": true } } }