diff options
author | makise-homura <akemi_homura@kurisa.ch> | 2022-06-23 20:09:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-06-28 15:12:04 (GMT) |
commit | b05d297964b4352b81f7ed4aab247609b6a4b0b7 (patch) | |
tree | 35a4dff1240ed28571907a159b7bf619d3dc4acd /Tests/CMakeOnly/AllFindModules | |
parent | 2faabab644571b84b485f6fe101d09af0759d3a2 (diff) | |
download | CMake-b05d297964b4352b81f7ed4aab247609b6a4b0b7.zip CMake-b05d297964b4352b81f7ed4aab247609b6a4b0b7.tar.gz CMake-b05d297964b4352b81f7ed4aab247609b6a4b0b7.tar.bz2 |
Tests: handle a case when hg executable is broken
OS Elbrus 6.0-rc1 to rc3 have hg executable broken
because of python2 and python3 module directories conflict.
Here, we avoid hg related tests if such case is detected.
Diffstat (limited to 'Tests/CMakeOnly/AllFindModules')
-rw-r--r-- | Tests/CMakeOnly/AllFindModules/CMakeLists.txt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 49a4041..0907d03 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -56,6 +56,15 @@ macro(check_version_string MODULE_NAME VERSION_VAR) if (NOT _exclude_pos EQUAL -1) message(STATUS "excluding check of ${VERSION_VAR}='${${VERSION_VAR}}' due to local configuration") elseif (${MODULE_NAME}_FOUND) + + unset(SKIP_CHECK) + if(${MODULE_NAME} STREQUAL "HG") + execute_process(COMMAND "${HG_EXECUTABLE}" --version OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE HG_RV) + if(NOT HG_RV EQUAL 0) + message(WARNING "Broken HG executable detected, skipping") + set(SKIP_CHECK TRUE) + endif() + endif() if (DEFINED ${VERSION_VAR}) message(STATUS "${VERSION_VAR}='${${VERSION_VAR}}'") if (NOT ${VERSION_VAR} MATCHES "^[0-9]") @@ -71,7 +80,9 @@ macro(check_version_string MODULE_NAME VERSION_VAR) message(SEND_ERROR "unexpected: ${VERSION_VAR} is NOT VERSION_GREATER 0") endif() else() - message(SEND_ERROR "${MODULE_NAME}_FOUND is set but version number variable ${VERSION_VAR} is NOT DEFINED") + if(NOT SKIP_CHECK) + message(SEND_ERROR "${MODULE_NAME}_FOUND is set but version number variable ${VERSION_VAR} is NOT DEFINED") + endif() endif() endif () endmacro() |