|
| 1 | +From 767ebcd136f8cb6c4c15a9d0dc73a2c54396cad2 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Bram Oosterhuis < [email protected]> |
| 3 | +Date: Thu, 11 Aug 2022 12:28:48 +0200 |
| 4 | +Subject: [PATCH] ConfigGenerator: - Change fatal error to a autor warning - |
| 5 | + Add option to skip compare |
| 6 | + |
| 7 | +--- |
| 8 | + Tools/cmake/FindConfigGenerator.cmake.in | 11 ++++++++--- |
| 9 | + 1 file changed, 8 insertions(+), 3 deletions(-) |
| 10 | + |
| 11 | +diff --git a/Tools/cmake/FindConfigGenerator.cmake.in b/Tools/cmake/FindConfigGenerator.cmake.in |
| 12 | +index e3a83c1f..b4c7aa06 100644 |
| 13 | +--- a/Tools/cmake/FindConfigGenerator.cmake.in |
| 14 | ++++ b/Tools/cmake/FindConfigGenerator.cmake.in |
| 15 | +@@ -27,7 +27,7 @@ endmacro() |
| 16 | + # COMPONENT The cmake component group defaults to PROJECT_NAME |
| 17 | + # ---------------------------------------------------------------------------------------- |
| 18 | + function(write_config) |
| 19 | +- set(optionsArgs ) |
| 20 | ++ set(optionsArgs SKIP_COMPARE) |
| 21 | + set(oneValueArgs CLASSNAME LOCATOR COMPONENT) |
| 22 | + set(multiValueArgs PLUGINS) |
| 23 | + |
| 24 | +@@ -93,6 +93,11 @@ function(write_config) |
| 25 | + set(_locator lib${MODULE_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) |
| 26 | + endif() |
| 27 | + |
| 28 | ++ set(COMPARE ON) # default on |
| 29 | ++ if(ARG_SKIP_COMPARE) |
| 30 | ++ set(COMPARE OFF) |
| 31 | ++ endif(ARG_SKIP_COMPARE) |
| 32 | ++ |
| 33 | + IncludeConfig() |
| 34 | + |
| 35 | + foreach(plugin ${_plugins}) |
| 36 | +@@ -184,7 +189,7 @@ function(write_config) |
| 37 | + endif() |
| 38 | + |
| 39 | + if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" AND |
| 40 | +- "${config_generated}" STREQUAL "Y") |
| 41 | ++ "${config_generated}" STREQUAL "Y" AND COMPARE) |
| 42 | + |
| 43 | + json_write("${CMAKE_CURRENT_BINARY_DIR}/config/${plugin}_legacy.json" ${plugin_config}) |
| 44 | + |
| 45 | +@@ -200,7 +205,7 @@ function(write_config) |
| 46 | + if(compare_result EQUAL 0) |
| 47 | + message(STATUS "config json files generated using legacy method and Python ConfigGenerator are identical") |
| 48 | + elseif( compare_result EQUAL 1) |
| 49 | +- message(FATAL_ERROR " Comparing the config json files generated using legacy method and Python ConfigGenerator: \n" |
| 50 | ++ message(AUTHOR_WARNING " Comparing the config json files generated using legacy method and Python ConfigGenerator: \n" |
| 51 | + " ${CMAKE_CURRENT_BINARY_DIR}/config/${plugin}_legacy.json and ${CMAKE_CURRENT_BINARY_DIR}/config/${plugin}.json are not identical \n" |
| 52 | + " This could mean one of the following: \n" |
| 53 | + " 1. Parameters are out of order \n" |
| 54 | +-- |
| 55 | +2.34.1 |
| 56 | + |
0 commit comments