summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2021-07-29 18:32:26 (GMT)
committerBrad King <brad.king@kitware.com>2021-08-20 13:35:12 (GMT)
commit6c92f80f2ecb106916534d4b88704432476b9006 (patch)
tree604b2a6816b2f79e491a3ea8e8b16cc9ab64eb64
parentefe139d1b835d126d7280d5bf615fe8149f923e5 (diff)
downloadCMake-6c92f80f2ecb106916534d4b88704432476b9006.zip
CMake-6c92f80f2ecb106916534d4b88704432476b9006.tar.gz
CMake-6c92f80f2ecb106916534d4b88704432476b9006.tar.bz2
cmake_host_system_information: Also set `USED_FALLBACK_SCRIPT`
If the OS identification was obtained via fallback script.
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.cxx5
-rw-r--r--Tests/RunCMake/cmake_host_system_information/CentOS6-stdout.txt1
-rw-r--r--Tests/RunCMake/cmake_host_system_information/Debian6-stdout.txt1
-rw-r--r--Tests/RunCMake/cmake_host_system_information/UserFallbackScript-stdout.txt1
4 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx
index 90240a1..1464220 100644
--- a/Source/cmCMakeHostSystemInformationCommand.cxx
+++ b/Source/cmCMakeHostSystemInformationCommand.cxx
@@ -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;
}
}
diff --git a/Tests/RunCMake/cmake_host_system_information/CentOS6-stdout.txt b/Tests/RunCMake/cmake_host_system_information/CentOS6-stdout.txt
index 803ee08..50dbb08 100644
--- a/Tests/RunCMake/cmake_host_system_information/CentOS6-stdout.txt
+++ b/Tests/RunCMake/cmake_host_system_information/CentOS6-stdout.txt
@@ -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`
diff --git a/Tests/RunCMake/cmake_host_system_information/Debian6-stdout.txt b/Tests/RunCMake/cmake_host_system_information/Debian6-stdout.txt
index 60d6425..4193d6f 100644
--- a/Tests/RunCMake/cmake_host_system_information/Debian6-stdout.txt
+++ b/Tests/RunCMake/cmake_host_system_information/Debian6-stdout.txt
@@ -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`
diff --git a/Tests/RunCMake/cmake_host_system_information/UserFallbackScript-stdout.txt b/Tests/RunCMake/cmake_host_system_information/UserFallbackScript-stdout.txt
index afcc000..acaf47e 100644
--- a/Tests/RunCMake/cmake_host_system_information/UserFallbackScript-stdout.txt
+++ b/Tests/RunCMake/cmake_host_system_information/UserFallbackScript-stdout.txt
@@ -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`