cmake_host_system_information: Also set USED_FALLBACK_SCRIPT

If the OS identification was obtained via fallback script.
This commit is contained in:
Alex Turbov 2021-07-29 21:32:26 +03:00 committed by Brad King
parent efe139d1b8
commit 6c92f80f2e
4 changed files with 7 additions and 1 deletions

View File

@ -287,6 +287,8 @@ std::map<std::string, std::string> GetOSReleaseVariables(
// Ugh, it could be some pre-os-release distro.
// Lets try some fallback getters.
// See also:
// - http://linuxmafia.com/faq/Admin/release-files.html
// 1. CMake provided
cmsys::Glob gl;
@ -358,8 +360,9 @@ std::map<std::string, std::string> GetOSReleaseVariables(
data.emplace(std::move(key), std::move(value));
}
// Try 'till some script can get anything
if (!data.empty()) {
// Try 'till some script can get anything
data.emplace("USED_FALLBACK_SCRIPT", script);
break;
}
}

View File

@ -2,5 +2,6 @@
-- CENTOS6_ID_LIKE=`rhel`
-- CENTOS6_NAME=`CentOS`
-- CENTOS6_PRETTY_NAME=`CentOS release 6\.10 \(Final\)`
-- CENTOS6_USED_FALLBACK_SCRIPT=`.*/Modules/Internal/OSRelease/010-TryOldCentOS.cmake`
-- CENTOS6_VERSION=`6\.10`
-- CENTOS6_VERSION_ID=`6\.10`

View File

@ -1,4 +1,5 @@
-- DEBIAN6_ID=`debian`
-- DEBIAN6_NAME=`Debian`
-- DEBIAN6_USED_FALLBACK_SCRIPT=`.*/Modules/Internal/OSRelease/020-TryDebianVersion.cmake`
-- DEBIAN6_VERSION=`6\.0\.10`
-- DEBIAN6_VERSION_ID=`6\.0\.10`

View File

@ -2,5 +2,6 @@
-- UFS_ID_LIKE=`nothing`
-- UFS_NAME=`UnitTest`
-- UFS_PRETTY_NAME=`Just a Unit Test`
-- UFS_USED_FALLBACK_SCRIPT=`.*/999-LastFallbackScript\.cmake`
-- UFS_VERSION=`0\.0\.1`
-- UFS_VERSION_ID=`0\.0\.1`