mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
Ext and External were used inconsistently in the code and the docs. This change converts all uses of Ext to External, including within variable names used by the generator.
32 lines
970 B
CMake
32 lines
970 B
CMake
function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_VAR)
|
|
set(${RESULT_VAR} "${NAME}-${VERSION}-*.json" PARENT_SCOPE)
|
|
endfunction()
|
|
|
|
function(getPackageContentList FILE RESULT_VAR)
|
|
set("${RESULT_VAR}" "" PARENT_SCOPE)
|
|
endfunction()
|
|
|
|
function(toExpectedContentList FILE_NO CONTENT_VAR)
|
|
set("${CONTENT_VAR}" "" PARENT_SCOPE)
|
|
endfunction()
|
|
|
|
set(ALL_FILES_GLOB "*.json")
|
|
|
|
function(check_ext_json EXPECTED_FILE ACTUAL_FILE)
|
|
file(READ "${EXPECTED_FILE}" _expected_regex)
|
|
file(READ "${ACTUAL_FILE}" _actual_contents)
|
|
|
|
string(REGEX REPLACE "\n+$" "" _expected_regex "${_expected_regex}")
|
|
string(REGEX REPLACE "\n+$" "" _actual_contents "${_actual_contents}")
|
|
|
|
if(NOT "${_actual_contents}" MATCHES "${_expected_regex}")
|
|
message(FATAL_ERROR
|
|
"Output JSON does not match expected regex.\n"
|
|
"Expected regex:\n"
|
|
"${_expected_regex}\n"
|
|
"Actual output:\n"
|
|
"${_actual_contents}\n"
|
|
)
|
|
endif()
|
|
endfunction()
|